Search code examples
iphonecustom-urlx-callback-url

iPhone: Is it possible to go back to the previous application after handling custom URL?


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?


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/