Instead of implementing -applicationDidFinishLaunching:
, you should implement the more modern delegate method -application:didFinishLaunchingWithOptions:
. You can then examine the launchOptions
dictionary and look for the key UIApplicationLaunchOptionsURLKey
. If you find that key in the dictionary, your app was launched in response to a custom URL. The URL itself is the value that corresponds to that key in the dictionary.
You can use the same method (looking for different keys, of course) to tell if your app was launched in response to a notifications, a location event, etc.