由于事件的顺序根据这两种情况中的哪一种正在进行而略有不同,我希望能够分辨出不同之处。有什么建议吗?
最佳答案
您不应使用 handleOpenURL
,因为它已被弃用。相反,请使用 application:openURL:sourceApplication:annotation:
(自 iOS 4.2 起可用)。
Apple's documentation在此处给出有关 application:openURL:sourceApplication:annotation
的问题的答案:
If your app had to be launched to open the URL, the app calls the application:willFinishLaunchingWithOptions: and application:didFinishLaunchingWithOptions: methods first, followed by this method. The return values of those methods can be used to prevent this method from being called. (If the application is already running, only this method is called.)
关于ios - 如何判断 handleOpenURL 是在应用程序启动时调用还是在应用程序运行时调用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18334829/