WEB-178Recommended
Open links in your phone apps
If you ship an iOS or Android app, publish /.well-known/apple-app-site-association and /.well-known/assetlinks.json, so links to your site open in the app.
How to do it
Serve both as application/json, over HTTPS, without a redirect. The Apple file has no file ending and lists the app IDs and the paths the app handles. Apple fetches it through its own CDN within 24 hours, and devices check for updates about once a week. The Android file gives the package name and the SHA-256 fingerprint of the signing certificate. With Play App Signing, use the fingerprint Google Play shows, not your upload key. Links that carry tokens or open account screens must use these verified links, as Open deep links only from verified domains requires. Push taps use the same links, as Open the exact page the push is about says.
Examples
JSON example
{
"applinks": {
"details": [
{ "appIDs": ["ABCDE12345.com.example.app"], "components": [{ "/": "/orders/*" }] }
]
}
}
Shell example
curl 'https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://example.com&relation=delegate_permission/common.handle_all_urls'
JSON example 2
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.example.app",
"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"]
}
}]
How to check
curl https://app-site-association.cdn-apple.com/a/v1/example.com returns your current file. Google's Digital Asset Links API lists the app for the site. A link to a listed path opens the app on iOS and on Android.
Sources
Related rules
- WEB-168 Serve standard files at fixed addresses in Website
- MOB-44 Open deep links only from verified domains in Mobile apps
- NTF-15 Open the exact page the push is about in Notifications
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/standard-addresses/app-links">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.