小编Sam*_*med的帖子

SceneDelegate 中未调用通用链接回调函数

根据我的应用程序项目设置,\n我使用相同的代码进行以下函数调用,以分别在 SceneDelegate 和 AppDelegate 中实例化 rootVC

\n
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {\n\n}\n\xe2\x80\xa8func application(_ application: UIApplication,\n                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?)\n        -> Bool {\n}\xe2\x80\xa8\n
Run Code Online (Sandbox Code Playgroud)\n

\xe2\x80\xa8\xe2\x80\xa8为了实现通用链接,我在我的 App Delegate\xe2\x80\xa8\xe2\x80\xa8 中有以下回调函数

\n
func application(_ application: UIApplication,\n                     continue userActivity: NSUserActivity,\n                     restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {\n//code to capture and setup universal link\n}\n
Run Code Online (Sandbox Code Playgroud)\n

\xe2\x80\xa8AppDelegate 中的这个函数仅在低于 iOS 13 的设备中调用。我寻找了 SceneDelegate 的类似回调等效项,我能找到的最接近的是这个函数。\xe2\x80\xa8\xe2\x80\xa8

\n
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {\n//code to capture and setup universal link\n}\n
Run Code Online (Sandbox Code Playgroud)\n …

deep-linking ios swift ios-universal-links swift3

5
推荐指数
1
解决办法
2183
查看次数

标签 统计

deep-linking ×1

ios ×1

ios-universal-links ×1

swift ×1

swift3 ×1