相关疑难解决方法(0)

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
查看次数

application:openURL:options: not called

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)

ios swift

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

标签 统计

ios ×2

swift ×2

deep-linking ×1

ios-universal-links ×1

swift3 ×1