How do I restart an application like facebook-ios-sdk?
I am actively looking at the source code of the facebook-ios-sdk Github project, but I was wondering if anyone knows how to restart the app that sent the iPhone user to Safari so that the user can come back after some work has finished?
When using facebook to login, the original app is restarted after the facebook login page is authenticated by the user.
I would like to be able to do the same for YouTube videos without having to completely lose the user. I don't want to take the standard webview approach because I don't want to provide extra space to allow the user to download the video first and then press the play button. I want to skip the play button and associated click completely! Instead, I want the user to only be able to click on the regular regular iPhone button and show the video via navigation to return to the app through a restart.
source to share
You need your application to register a "custom url scheme". Then get a callback on the remote web service to return the url with this scheme. iOS will launch your app.
- More (somewhat old) information is available here.
- A list of common custom URL schemes on iOS can be found here.
Typically, as part of the OAuth login process, you specify the callback URL as one of the parameters. What it means tells the remote server (YouTube) that upon successful authentication it will redirect the user to the specified URL. If YouTube supports this (does it support OAuth?), Then on successful safari login, youtube will inform safari users to redirect to the attached URL. If this url is a "custom url scheme" it will bring your application back up and you should be able to handle the situation from there.
source to share