Short answer: iOS only uses rules whose app ID matches the installed app exactly. The value must be the Application Identifier Prefix (usually your Team ID), a dot, then the bundle ID, for example ABCDE12345.com.example.app. A bundle ID on its own, or the wrong prefix, matches nothing.
What is happening
AASA app ID: the string in appIDs (or the legacy appID) that tells iOS which app may open the URLs, written as <Application Identifier Prefix>.<Bundle Identifier>.
Apple says "the apps in the apple-app-site-association file on your website must have a matching" Associated Domains entitlement. If the ID in the file is for a different app, or is written in the wrong form, iOS treats the file as having no rules for your app.
- The file can be perfect in every other way and still fail.
- The file downloads with a 200, but links still open Safari on a device with the app installed, because the app ID in the file is not your app.
Why does this happen?
The prefix and bundle ID come from different places, and it is easy to copy one wrong. Staging, white-label and renamed apps often have bundle IDs that differ by a suffix.
- Bundle ID only:
com.example.appwithout the prefix. - Wrong prefix: an old Team ID, or another team's ID after an app transfer.
- Wrong bundle:
com.example.app.devin the file while the release build iscom.example.app, or the reverse. - Case or typo: bundle IDs are matched exactly.
How to confirm it
- In Xcode, open the target's Signing & Capabilities tab and note the bundle identifier and team.
- Find your Team ID in your Apple Developer account and check it matches the prefix in the file.
- Fetch the file:
curl -s https://example.com/.well-known/apple-app-site-associationand compare each entry inappIDs. - Compare each
appIDsvalue character by character with your Team ID and bundle ID in Xcode, then check the live file withcurl -I https://example.com/.well-known/apple-app-site-association. - On a Mac, run
sudo swcutil verify -d example.com -j apple-app-site-association -u https://example.com/your/path. Apple's technote lists a wrong Team ID or bundle ID as a reason this fails to match.
How to fix it
- Build the ID as prefix, dot, bundle ID:
ABCDE12345.com.example.app. - Add every build that should open links, such as release and internal builds, to the same
appIDsarray. - Check the app's entitlement lists
applinks:for the same domain. - Deploy the file, then reinstall the app so the device fetches the new version.
{
"applinks": {
"details": [
{
"appIDs": [
"ABCDE12345.com.example.app",
"ABCDE12345.com.example.app.beta"
],
"components": [{ "/": "/*" }]
}
]
}
}
Build the ID as prefix, dot, bundle ID, so the dot and prefix are always in the right place. If the ID is right but some links still fail, see path not matched or the universal links setup guide.