0
votes

I'm using this function in my app, to handle calls from other applications:

(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation

I need to understand how can I re-launch the app that has launched my app after I finished handling the request.

In short - I need the source app to be in foreground once I have finished handled issues in my app.

Here the flow:

  1. User click on some button on 3rd party's app (it can be any app, not a specific one)
  2. the button uses

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:sourceApplication]]

to open my app.
  1. I perform some actions in my app.
  2. The 3rd party's app (source app) re-opened.

Any ideas?

Thanks!

(btw - I think that Facebook API does that too, but not sure.)

1

1 Answers

3
votes

Facebook does that because they know your app's url since you have to add fb[APPID] url where [APPID] is your Facebook app ID.

There is this idea for a specification that handles what you want: http://x-callback-url.com but in order to use it, both apps would have to support it.

Using x-callback-url’s source apps can launch other apps passing data and context information, and also provide parameters instructing the target app to return data and control back to the source app after executing an action.