Background:
- our app uses different bundle ids for development builds vs beta builds vs production (App Store) builds
- I am currently implementing Universal Links in our development builds
- Our production build currently in the App Store does not support Universal Links
I am experiencing this crazy issue where not only are my Universal Links not opening the development version of the app, they are launching the production version instead, despite the production version not having the proper entitlements.
My apple-app-site-association
file has been validated using both https://branch.io/resources/universal-links/ and https://search.developer.apple.com/appsearch-validation-tool/ and looks like so:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "DY74R9XXXX.com.myapp.consumer.debug",
"paths": [ "/profiles/*", "/messages/*"]
},
{
"appID": "DY74R9XXXX.com.myapp.consumer",
"paths": [ "/profiles/*", "/messages/*"]
}
]
}
}
According to https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html the details
array should be evaluated in order and stop after finding a match.
The order of the dictionaries in the array determines the order the system follows when looking for a match, so you can specify an app to handle a particular part of your website.
The intention is that the same Universal Link will load in the development version for anyone on my team, and in the production version for end-users who don't have the .debug
package on their phone.
Not only does this not work, but as mentioned, the Universal Links always load the production version, even though the production version lacks the applinks:dev.myserver.com
entitlement that points to me apple-app-site-association
file. This seems crazy but it would imply that I can launch arbitrary packages that I didn't publish and that the entitlements file isn't enforced.
Furthermore, if I remove the second entry from the details
array and only leave the dictionary for the debug version, the Universal Links fail to work, and open Safari instead. Switching the order of the array has no effect either. I have experienced this behavior on an iPhone 6s on both 9.3 and 9.3.1. Any advice on these two isses (launching the wrong package, and not launching the debug package when it's the only entry) is greatly appreciated!