根据我的应用程序项目设置,\n我使用相同的代码进行以下函数调用,以分别在 SceneDelegate 和 AppDelegate 中实例化 rootVC
\nfunc 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\nRun Code Online (Sandbox Code Playgroud)\n\xe2\x80\xa8\xe2\x80\xa8为了实现通用链接,我在我的 App Delegate\xe2\x80\xa8\xe2\x80\xa8 中有以下回调函数
\nfunc application(_ application: UIApplication,\n continue userActivity: NSUserActivity,\n restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {\n//code to capture and setup universal link\n}\nRun Code Online (Sandbox Code Playgroud)\n\xe2\x80\xa8AppDelegate 中的这个函数仅在低于 iOS 13 的设备中调用。我寻找了 SceneDelegate 的类似回调等效项,我能找到的最接近的是这个函数。\xe2\x80\xa8\xe2\x80\xa8
\nfunc scene(_ scene: UIScene, continue userActivity: NSUserActivity) {\n//code to capture and setup universal link\n}\nRun Code Online (Sandbox Code Playgroud)\n … I have created html with following body:
<html>
<head>
<meta http-equiv="Refresh" content="3; URL='MyApp://?Success'">
</head>
<body>
success
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
When i try to open page where html uploaded. from my iphone (safari) my app successfully opened but
application:openURL:options:
Run Code Online (Sandbox Code Playgroud)
does not called. Have u any ideas?
my info plist look like this:
<array>
<string>MyApp</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>MyApp</string>
</array>
<key>CFBundleURLName</key>
<string>url here</string>
</dict>
</array>
Run Code Online (Sandbox Code Playgroud)
My appDelegate Methods:
func application(_ app: UIApplication, open url: URL, options [UIApplication.OpenURLOptionsKey : Any] = …Run Code Online (Sandbox Code Playgroud)