Reputation: 19
I've created a demo project for enable universal link and followed all the below steps -
Handle link activity in AppDelegate (Swift 4.2 ,Xcode 10.1) - AppDelegate :
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
print("Activity")
if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
let url = userActivity.webpageURL!
print(url.absoluteString)
//handle url and open whatever page you want to open.
}
window = UIWindow(frame: UIScreen.main.bounds)
let ViewController = UIViewController()
window?.rootViewController = ViewController
window?.makeKeyAndVisible()
return true
}
My AppId and prefix both are same
Create a apple-app-site-association File and Placed in .well-known folder :
https://mobiledemo.socialengineaddons.com/.well-known/apple-app-site- association
My domain name is also ssl certified and also i've use this command to remove validator error -
Sign apple-app-site-association association
sudo touch json.txt | openssl smime -sign -inkey myserver.key -signer mobiledemo.socialengineaddons.com.crt -noattr -nodetach -outform DER
apple-app-site-association
Link Validator : Successfully validate domain (mobiledemo.socialengineaddons.com)
https://branch.io/resources/aasa-validator/#resultsbox https://limitless-sierra-4673.herokuapp.com/
Note: When we place apple-app-site-association file on root , validator gives error, so we placed this on .well-known folder 11. When i added my website link on Notes (IOS app) https://mobiledemo.socialengineaddons.com and long press , it not show any open to open in my app also when i click on this link every-time it's open in safari instead of app 12. I've followed below reference Links :
https://medium.com/@abhimuralidharan/universal-links-in-ios-
79c4ee038272
https://www.raywenderlich.com/6080-universal-links-make-the-
connection
https://www.youtube.com/watch?v=IEXn7QIwPFo
13. It'll very help-full to me, if you provide any suggestions to enable universal link , Thanks In Advance [1]: https://i.sstatic.net/rQBTW.png [2]: https://i.sstatic.net/esB8f.png
[1]: http://%20com.seao.seiosnativeapp
Upvotes: 1
Views: 1969
Reputation: 684
In Capabilities add app-links prefix and colon. applinks prefi is mandatory. So it would look like below.
applinks:mobiledemo.socialengineaddons.com
Upvotes: 1