Where can I upload 'apple-app-site-association' for universal link setup in my iOS app?.
How can I use universal link in my iOS app?. I am getting just confuse to read a lot of tutorials. Can anyone help me?
You need to upload apple-app-site-association file to the root directory of the server(from where you need to redirect to your installed app).
e.g- Suppose you have to redirect from www.abc.com/getapp then you need to upload the apple-app-site-association file to the root directory where the www.abc.com is get hosted.
Steps to support universal links-
Create your apple-app-site-association file(Suppose your universal link is www.abc.com/getapp and you want to redirect in your app from here).
{
"applinks": {
"apps": [],
"details": [
{
"appID": "9JA89QQLNQ.com.apple.wwdc", //9JA89QQLNQ is your team ID & com.apple.wwdc is your bundle id
"paths": [ "/getapp"]
}
]
}
}
Upload this file to the root directory where www.abc.com is hosted.
Now prepare your app to support universal links-
a. Go to developer.apple.com and enable Associated Domains to your app ID.
b. Select your target and turn on Associated Domains switch.
d. Add application:continueUserActivity:restorationHandler:
app delegate method so that your app can receive a link and handle it appropriately.
Not getting callback to the app-
1.When a user is browsing your website in Safari and they tap a universal link to a URL in the same domain as the current webpage, iOS respects the user’s most likely intent and opens the link in Safari.
2.Copy and paste your universal link(http(s)://www.abc.com/getapp
) to notes and tap on it. It your app can handle this link you will get the option Open in "AppName"
.
References-
Hope it may help.