I am making an app that has multiple usage cases. It has the main functionality (activated by pressing the app icon), then other subsets of the main functionality which are activated by a custom URL scheme.
To explain my problem, I should explain how I currently tell my app to behave differently.
I have been using: -(BOOL)application:didFinishLaunchingWithOptions:
grabbing the url from the options: [launchOptions objectForKey:[keyArray objectAtIndex:0]]
Now I parse that urlString and grab all of my launchType parameters, putting them in NSUserDefaults. Then I wait for my splash screen to come up, then it will tell my app how to behave.
This seemed okay at first, but then I realized that: if I deep-link into the app, and am presented with functionality B, then the app goes into the background, the next time the app take the foreground (no matter which way), it will display functionality B.
I was wondering if anyone had an idea about the standard practice, what methods do people usually use?
FYI, I am going to be trying to fix this problem by telling my navigationcontroller to popToRootViewController, when -(BOOL)application:application handleOpenURL: is called, UNLESS didFinishLaunchingWithOptions is called before it, in which case, just do what I had previously implemented.