Method 'scene(_:openURLContexts:)' is not called

后端 未结 3 1157
深忆病人
深忆病人 2021-01-17 10:44

In info.plist file I configured URL Identifier and URL Scheme successfully. Also I am able to open app using custom URL. The problem is when app la

3条回答
  •  一个人的身影
    2021-01-17 11:33

    I had the same problem, and the method scene(_ scene:, continue userActivity:) was only called when the app is open.

    When I checked the connectionOptions passed to the method scene(_ scene:, willConnectTo session, options connectionOptions:) it had a user activity with the expected URL. So, I ended up calling the first method manually:

    func scene(_ scene: UIScene,
               willConnectTo session: UISceneSession,
               options connectionOptions: UIScene.ConnectionOptions) {
    
        if let userActivity = connectionOptions.userActivities.first {
            self.scene(scene, continue: userActivity)
        }
    }
    

提交回复
热议问题