简体   繁体   中英

Deep linking is not working in SwiftUI iOS (open url appdelegate method is not triggerd)?

I am working on SwiftUI app in which trying to perform deep linking. when I manually open the browser and put "myapp://" its navigating to app correctly. But in actual I am opening safari within app and after deep link success I want to call below appdelegate method

I am using sfsafariviewcontroller

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
            print("myapp")
        return true
    }

below is my work

在此处输入图片说明

Thank You for help

From the documentation this method seems to be the one you can directly use with SFSafariViewController

func safariViewController(_ controller: SFSafariViewController, 
            didCompleteInitialLoad didLoadSuccessfully: Bool)

Documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM