Question

in my app I need to open a url by using

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"urlstring"]];

after a certain process in the page how can i return to the app.(like facebook doing for safari authentication)

Was it helpful?

Solution

You can't unless you also build the website part, then you can open your own app by calling the App custom URL scheme, wich you will have to add your self to info.plist.

OTHER TIPS

What the Facebook app does is it registers fb:// URLs to redirect to it. Then it sends you to a special link at facebook.com that redirects to an fb:// link while passing some information along (a token or whatever). If you open Safari and type "fb://" into the URL bar you'll get sent to the Facebook app. rckoenes' answer shows how to register URLs to do that, but the part about returning to your app is up to your website (you have to write that redirect page).

This might work?

UIWebView webView = [[UIWebView alloc] init]; 
NSURL *url = [NSURL URLWithString:@"urlstring"]; 
[webView loadRequest:[NSURLRequest requestWithURL:url]];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top