Question

I know that iPhone applications can be launched via a custom URL such as myapp://something. But is there a way to go back to the previous application after handling the custom URL?

For example, I have the following scenario.

  1. Follow a link from iPhone Twitter application.
  2. Twitter shows a link that redirects to a custom URL.
  3. My application is invoked and handles the URL.
  4. After completing the job, I go back to the Twitter app.

I want my application to handle a custom URL like a modal dialog box. Is it possible?

Was it helpful?

Solution

While this isn't officially supported, it is totally doable: take a look at the x-callback-url spec. It's been implemented by several apps, like Due and Instapaper:

http://x-callback-url.com/

OTHER TIPS

That I guess is not possible unless both apps are yours and you implement a custom url for each other.

The method that you use to handle launching app from a custom URL has a param called source application which gives you info about the bundle ID of the app that launched your app. Maybe try using that to launch the calling app again.

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top