ios - 如何判断 handleOpenURL 是在应用程序启动时调用还是在应用程序运行时调用?

标签 ios

由于事件的顺序根据这两种情况中的哪一种正在进行而略有不同,我希望能够分辨出不同之处。有什么建议吗?

最佳答案

您不应使用 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/

相关文章:

ios - 使用 AVFoundation 播放 IOS 音乐库内容

ios - 3D Touch peek 和 pop 问题

iphone - 错误 24(打开的文件太多)- iPhone

ios - 如何停止 UITextView 滚动 UITableView

ios - 获取应用程序使用情况统计信息的 iOS api 是什么?

ios - 底角不是圆的

iphone - UITextField 中的占位符和文本不在同一位置(缩进不同)

ios - 什么是已弃用的推送转场? (iOS 8)

ios - 在弹出窗口上显示导航栏

ios - 使用 OSX 10.11 Beta 5 (El Capitan) 设置 IPv6 环境