Basically, whenever the app launches or opens I have a check to see if there's a link on the clipboard, and if so I ask the user if he/she wants to add it.
However, I recently added the ability to use x-callback-urls to add URLs into the app. If they use an app like LaunchPad to open a URL in my app, the "do you want to add the URL from your clipboard?" notification still opens, which doesn't make much sense as they've already launched it to add that URL.
Problem is, the openURL:
method in my AppDelegate is called to handle the URL scheme after appDidFinishLaunching
and appWillEnterForeground
, so I can't put a check in those to see if the openURL
method was already called. I could use a dispatch_after
, but that seems lazy and hacky.
Is there a way to check how the app was launched, i.e.: via a URL scheme or via a manual open?