An https deep link opens an app only when the domain says the app may open it. Apple reads that from apple-app-site-association, Android from assetlinks.json, and both are small JSON files with strict rules about where and how they are served. This is what each must contain, and how to check it before a phone does.
Where they live, and how they are served
| Rule | apple-app-site-association | assetlinks.json |
|---|---|---|
| Address | https://<domain>/.well-known/apple-app-site-association |
https://<domain>/.well-known/assetlinks.json |
| Name | no extension | .json |
| Transport | https, with a valid certificate | HTTPS, whatever scheme the app's intent filter uses |
| Redirects | none | no 301 or 302 |
| Content type | not set by Apple's pages | application/json |
| One per | every domain and subdomain in the entitlement | every host in the intent filters (for a wildcard host, the root domain) |
From Supporting associated domains, TN3155, Configure assetlinks.json and Add App Links. Apple also asks that the file be reachable from every IP address and for any user agent (TN3155). Firebase's migration guide serves both files with a Content-Type: application/json header (Firebase).
Google is explicit that the location is not negotiable: a statement list anywhere else, or under another name, is not valid for the site (Digital Asset Links).
apple-app-site-association, field by field
{
"applinks": {
"details": [
{
"appIDs": ["ABCDE12345.com.example.app"],
"components": [
{ "/": "/buy/*", "comment": "Matches any URL with a path that starts with /buy/." },
{ "/": "/help/website/*", "exclude": true }
]
}
]
}
}
appIDs: each app as<Application Identifier Prefix>.<Bundle Identifier>, the prefix and the bundle ID joined by a full stop (Supporting associated domains).components: the URL patterns the app opens; a pattern with"exclude": truekeeps matching URLs in the browser (Supporting associated domains).- The older form,
appIDandpaths, still works, but do not mix the two in one file (TN3155).
assetlinks.json, field by field
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.example",
"sha256_cert_fingerprints": ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
}
}]
relationisdelegate_permission/common.handle_all_urlsfor App Links, andtargetnames the app; the file declares which apps may handle links for your domain (Configure assetlinks.json).package_nameis the application ID frombuild.gradle.sha256_cert_fingerprintslists the SHA-256 fingerprints of the signing certificate, several if you sign debug and release builds differently. With Play App Signing, take them from Play Console, Release, Setup, App signing, not from your own keystore (Configure assetlinks.json).- One file can hold statements for several apps (Configure assetlinks.json).
Check them from the command line
What the server returns, headers included (the first command is Apple's, from TN3155):
curl -v https://example.com/.well-known/apple-app-site-association
curl -sI https://example.com/.well-known/assetlinks.json
Apple's own validator, swcutil, on a Mac: dl checks that the file can be downloaded, and verify checks a saved copy of it (-j) against the domain (-d) and a URL (-u) (TN3155):
sudo swcutil dl -d example.com
sudo swcutil verify -d example.com -j ./example.json -u https://example.com/buy/42
Google's Digital Asset Links API lists the statements it can read from a site (statements.list):
curl "https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://example.com&relation=delegate_permission/common.handle_all_urls"
Google's Statement List Generator and Tester takes the domain, the package name and the SHA-256 fingerprint, and tests the file against them.
What a passing check does not prove
- iPhones do not read your server: since iOS 14 they ask Apple's CDN, which requests your file within 24 hours, and devices look for updates about once a week (Supporting associated domains).
- Android verifies when the app is installed; Android 15 and later re-verify in the background, which can take up to seven days to reach every device (Verify App Links).
So a file that is right today can still be the old one on a phone. The device's own answer is in Apple's Developer settings diagnostics and in adb shell pm get-app-links (TN3155, Verify App Links). When the files pass and a phone still does the wrong thing: a universal link opens Safari, an Android app link shows the chooser.
Test it in Diver
- In the browser build at https://app.usediver.com, give each environment its link domain, Apple team ID, iOS bundle ID, Android package and SHA-256 fingerprints. Diver generates both files from them, one pattern per deep link template, and warns when a field is missing (for example that
assetlinks.jsoncannot be generated without a package name). The admin console shows both files to copy or download, with the hosting rules above. Diver does not host them: your domain serves them, pasted in, or proxied from Diver with an API key so they stay in step with the environment (link files). - In the desktop or phone app (coming soon), press Check. Diver fetches both files from the link domain and answers per file:
Served and claims this app.,Could not reach the domain.,Nothing is served here.,Served, but not valid JSON.,Redirected - Apple will not follow one for this file., orServed, but it does not claim this app.with what is missing: the team ID and bundle ID, the package, or a fingerprint. A browser cannot run the check: the files are served for Apple and Google, not for a web page. - Diver compares the claim, not the paths: it does not test
components, therelationor the content type. Pair it withswcutil verifyfor paths andcurl -sIfor the header.
The phone and desktop apps are coming soon: tell me when they ship.