nburk
nburk

Reputation: 22731

Is it possible to determine how an iOS app was opened?

Is it possible for an iOS app (for example in applicationDidBecomeActive:) to determine how or from where it was opened. In particular, if the app was opened by another app using a URL scheme, is it possible to get the information about the app that triggered the opening?

Upvotes: 1

Views: 61

Answers (1)

Msencenb
Msencenb

Reputation: 5104

Take a look at this method in the ApplicationDelegate protocol:

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

This is what is called when another application tries to open your app with a custom url scheme. According to the docs....

Your implementation of this method should open the specified URL and update its user interface accordingly.

but you also get a little information about the caller as well.

Upvotes: 4

Related Questions