`scene(_ scene: UIScene, continue userActivity: NSUserActivity)` doesn't get called when the app is launched after the user clicks on a universal link

风格不统一 提交于 2019-12-06 21:50:34

You almost had it:

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
    if let userActivity = scene.userActivity { // <-- not quite
        self.scene(scene, continue: userActivity)
    }
}

It's not in the scene; it's in the options. Look in the options.userActivities. (Though if what has happened is that the user clicked a link to launch us, I would expect to find the URL in the options.urlContexts.)

Apple responded confirming that issue in iOS 13.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!