0

I have serve apple-app-site-association in my HTTPS root (kumpul.co.id/apple-app-site-association) and the result is passed from https://branch.io/resources/aasa-validator/#resultsbox

I have configured it in my entitlements: applinks:kumpul.co.id

and i have put this function in my Appdelegate.swift:

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
    NSLog("Check Universal Link")
    // 1
    guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
        let url = userActivity.webpageURL,
        let components = URLComponents(url: url, resolvingAgainstBaseURL: true) else {
            return false
    }
        print("url: \(url)")
    print("component: \(components)")

    // 2
    if let match = MatchHandler.sharedInstance.items.filter({ $0.path == components.path}).first {
        self.presentMatch(match)
        return true
    }
    //3
    let webpageUrl = URL(string: "http://www.kumpul.co.id")!
    application.openURL(webpageUrl)

    return false
}

For the paths, i set "paths": [ "/match/*"] because the links would be kumpul.co.id/match/play_2.html for example

but when i click my link on WhatsApp or Line message, this function doesn't called at all, i can't see the logs when i click the link. What am i doing wrong here ?

calvin sugianto
  • 610
  • 7
  • 27

1 Answers1

1

Line is not compatible with Universal Links, so that test case is invalid. Your app won't open when a Universal Link is clicked in Line, even if everything is configured perfectly (you need to offer a web preview of the content with a call-to-action button, like this — the same problem exists on Facebook, by the way).

WhatsApp should be working. If your app is not even launching when the link is clicked, you have a configuration issue. You can try walking through some of the troubleshooting steps on this page. If your app is launching, then your configuration is correct and you should verify the logic inside continue userActivity

Community
  • 1
  • 1
Alex Bauer
  • 13,147
  • 1
  • 27
  • 44
  • when i check my link ( https://www.kumpul.co.id.match/play_70.html ) on https://search.developer.apple.com/appsearch-validation-tool/ , it said "Error no apps with domain entitlements The entitlement data used to verify deep link dual authentication is from the current released version of your app. This data may take 48 hours to update." but, from https://branch.io/resources/aasa-validator/#resultsbox, it passed all of the validation, how come this could happen ? I have added my entitlement in my project as applinks:kumpul.co.id – calvin sugianto Mar 10 '17 at 04:39
  • That is the "App Search API Validation Tool", not the "Universal Links Validation Tool" (which doesn't exist from Apple). The results from this tool have no connection to whether Universal Links work or not – Alex Bauer Mar 10 '17 at 08:54