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 ?