Reputation: 11
I have implemented universal links in my app with following steps :-
txt file has been uploaded on server with format :-
{"applinks": {"apps": [], "details": [{"appID": “teamId.com.abcd.efgh”, "paths": ["*"]}]}}
checked the site with validation which shows
a) apple validator enter image description here
b) aasa-validator enter image description here 
Implemented the function in my appDelegate but it is never called
func application(_ application: UIApplication, continue userActivity: NSUserActivity,restorationHandler: @escaping ([Any]?) -> Void) -> Bool {}
My universal link is not working I am not able to redirect my app from links in notes or from any place. I have implemented all the neccessary steps I know. I am not able to debug the issue.
Upvotes: 0
Views: 779
Reputation: 371
You mentioned it as txt file but it should be a file with no extension and the name of the file should be "apple-app-site-association" and it must be present in root directory or .well-known directory in your server.
Check this article:
https://developer.apple.com/documentation/xcode/supporting-associated-domains
Upvotes: 0
Reputation: 104
Your AppDelegate implementation is not complete yet, you need to get your url from the received NSUserActivity object as declared here in apple documentations, use following method to complete your appDelegate implementation:
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let url = userActivity.webpageURL
else
{return false}
return true
}
Then, you can use this url
and send it to whatever ViewController want to load it in.
Hope this helps;)
Upvotes: 1