application(…continue userActivity…) method not called in ios 13

前端 未结 2 581
情歌与酒
情歌与酒 2020-12-09 16:24

Hi I\'m making ios app using UniversalLink.

Universal Link works fine, but callback method is not called.

My AppDelegate.swift is below.



        
2条回答
  •  無奈伤痛
    2020-12-09 17:01

    I had a similar issue with SceneDelegate and universal links where I could not get to NSUserActivity when the app was just launched (in this case Background NFC reading in ios 13).

    As mentioned in the answer by @Jan, continue userActivity is now in the SceneDelegate.

    If the app is running or in the background ie. closed, a universal link will fire the scene(_:continue:) delegate.

    If the app is not in the background, a universal link won't fire up from the scene(_:continue:) delegate. Instead, the NSUserActivity will be available from scene(_:willConnectTo:options:). eg.

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        if let userActivity = connectionOptions.userActivities.first {
            debugPrint("got user activity")
        }
    }
    

提交回复
热议问题