简体   繁体   中英

iOS Universal Links (on Debug) not working?

I'm attempting to check the parsing of a Universal Link on an app I'm working on from within xcode debugger. I have everything working fine for some Universal links on the release build, but I want to walk through the process on debug. But after triple checking everything it just never checks for the app association file when a link is tapped from notes or google search. (Verified from packet sniffing within Charles Proxy both from simulator AND device)

Should this be working on debug?

Yes you can debug universal link using the following method in AppDelegate.swift file. , developer profile must be included with an associated domain for debugging. , I hope this helps you.

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
       print("activityType: ", userActivity.activityType)
        if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
            let univrsalLinkURL = userActivity.webpageURL!.absoluteString
            print(univrsalLinkURL)
        }
        return true
    }

Goto developer account and check provisioning profile it's content must be associated domain enabled see this image.

在此处输入图片说明

Send the link in simulator message application. And click on that it will help you in debugging.

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