doodledood
doodledood

Reputation: 417

Is it possible to go back to previous open app programatically in iOS?

I want the user to automatically be taken back to the app he came from when he finishes interacting with my app. Is it possible?

Upvotes: 2

Views: 3271

Answers (1)

Ankit Srivastava
Ankit Srivastava

Reputation: 12405

I think this may be possible.. if the user opened your app from inside another app then he would have obviously opened your application via URL scheme. The source application will have the bundle identifier of the app from which it was opened from safari. So you can open safari from your application using url scheme. The only limitation is that you can only open a limited number of applications and not everyone which is available on the users phone as you won't have access to the entire URL schemes list.

Here is a list of common url schemes.

http://aijazansari.com/urlschemelist/#Phone

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
    [IXIGATrackerUtil trackCampaign:url];

Upvotes: 2

Related Questions