Domanda

If i start my app via urlscheme i get the url in launchoptions in application:didFinishLaunchingWithOptions: and handle it there and return YES, but application:openURL:sourceApplication:annotation: is also called and therefore url is handled twice. According to this post openURL should only be called if didFinishLaunchingWithOptions returns NO. Anyone has any idea why this is happening?

È stato utile?

Soluzione

I think that you are supposed to handle the url in: application:openURL:sourceApplication:annotation: as it can be called while you application is running and so application:didFinishLaunchingWithOptions: would not get called. It only passes it into the didFinishLaunching... method so that you can know the reason you are being launched and if you want you can prepare, knowing that you are going to open the url.

At least, this is how I have handled this in the past.

Hope this helps.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top