1

I need to know if my app was launched from the "open" button in the App Store. As far as I know, I can do this code in didFinishLaunching:

if let launchOptionKey = launchOptions?[.sourceApplication] {    
            if (launchOptionKey as AnyObject).isEqual("com.apple.AppStore") {
                // Do specific code
            }
        }

How could I simulate a launch from the App Store, to be able to test this code?

4

1 回答 1

0

根据我的经验,似乎无法跟踪它们是来自应用商店的“打开”按钮还是来自主屏幕打开应用。我可能建议的一种解决方法是使用Branch SDK 并检查+is_first_session参数是否设置为 true。如果是这种情况,那么您可以相当肯定用户是来自应用商店的第一次会话。

您可以在iOS 深层链接路由指南中查看它是如何完成的。

于 2017-07-31T21:17:11.533 回答