We added associated domains in our ios APP, like this:
<string>webcredentials:*.mywebsite.com</string>
<string>applinks:*.mywebsite.com</string>
We also uploaded apple-app-site-association file for all our subdomains. Like below:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "XXXXX.com.mywebsite.www",
"paths": [
"NOT /whatever",
"some other paths here",
"/"
]
}
]
},
"webcredentials": {
"apps": [
"XXXXX.com.mywebsite.www"
]
}
}
It works fine if user click a url on google page which links to www.mywebsite.com, it will open the APP.
But my problem is, if we have a subdomainA.mywebsite.com/test.html, like this:
<a href="https://www.mywebsite.com/">HOME</a>
If user click the link, it will also open the APP, this is NOT what i want.
So my question is, how can i disable universal link opening the APP if on subdomainA user clicks a url that links to subdomainB, and the url's path is registered in app site association file. Can ios know they are just subdomains so don't open the APP?
You can disable Universal links by blacklisting the paths in your AASA file. Adding NOT before the path in your AASA file won't trigger app open for your url.
{
"applinks": {
"apps": [ ],
"details": [
{
"appID": "XXXXX.com.mywebsite.www",
"paths": [ "http://www.mywebsite.com/", "NOT http://www.subdomainA.mywebsite.com/test.html"]
}
]
}
}
Here is the apple documentation for the same: Universal Links
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With