App links (Android) and universal links (iOS) are web links that open directly in your installed app instead of a browser, if you have configured them properly. The short version: you host an association file on the same domain as the link, you declare the domain in the app, and you make sure the link URL paths in the file match what the app can handle. Miss one of those three and the link silently falls back to the browser, which is why most setups fail on the first try.
This guide covers domain setup and file placement, because those are where nearly all the work happens. Exact labels in developer consoles and app settings can differ slightly by version, platform and region, so treat any menu path below as a general direction rather than a word-for-word script.
What You'll Need
- Control of the website domain you want links to open from (e.g. example.com), including the ability to upload files to a specific path.
- HTTPS on that domain, with a valid certificate. Both systems require it.
- A signed app build with the correct bundle ID (iOS) or package name (Android).
- Your Apple Team ID (iOS) or your app's signing certificate SHA-256 fingerprint (Android).
- Access to the Apple Developer portal and/or Google Play Console.
- A build of the app installed on a real device for testing. Simulators and emulators are unreliable for this.
Step-by-Step
Decide which URL paths belong to the app. Do not send the whole domain to the app. Pick specific paths such as /products/* or /watch/* and leave everything else to the browser. Both platforms let you scope the association to particular paths, and a narrow scope is far easier to debug.
Host a verification file on the domain. Android looks for /.well-known/assetlinks.json. It is a small JSON array declaring your package name and the SHA-256 fingerprints of the certificates that may sign the app. iOS looks for an Apple App Site Association file served at /.well-known/apple-app-site-association, or at the domain root if you prefer. On iOS the file has no .json extension, and that trips people up constantly.
Serve both files correctly. They must be reachable over HTTPS with no redirect chain. iOS expects the association file to be served as JSON with an appropriate content type; Android is more forgiving but still wants a clean 200 response. Check that your CDN or hosting panel is not stripping the .well-known directory or intercepting the path.
Write the Android file. Each entry needs the target package name and an sha256_cert_fingerprints array. Include the debug signing fingerprint while testing and add the Play App Signing fingerprint before you ship, or the store build will refuse to verify.
Write the iOS file. The top level contains an applinks object with a details array. Each detail lists a teamID, a bundleID and the paths your app claims. Keep the path list tight and consistent with what you decided in step 1.
Declare the domain in the app. On Android, add an intent filter for your host that includes automatic verification. On iOS, enable the Associated Domains capability and add entries of the form applinks:example.com. Then create a new build and install it. Domain changes do not take effect in an already installed app.
Handle the incoming link in code. The app must actually recognise and route the URL. If the operating system hands your app a link it does not understand, the user lands on an empty screen, which looks like a configuration failure even when verification passed.
Verify on a real device. Uninstall the old app copy first, install the new build, then tap a link from a messaging app or notes app, not from the address bar where typing may behave differently. Confirm it opens the app at the right screen and that a non-claimed path still opens the browser.
Test the fallback. With the app uninstalled, the same link should open the standard web page. This is your safety net for new users and for anyone on another platform.
Common Mistakes
- Mismatched fingerprints. Testing works, the store build does not, because Play App Signing re-signs the app with a different certificate. Add that fingerprint too.
- Wrong file name or extension. Adding .json to the Apple file, or placing the Android file outside /.well-known/, breaks verification silently.
- Redirects and auth walls. A verification file behind a login page or a HTTP-to-HTTPS or www redirect will not be fetched. It must be publicly readable at exactly one address.
- Claiming too much. A wildcard that grabs every path on the domain takes login, password reset and marketing links away from the browser and breaks them.
- Testing on an old install. The system caches verification. Reinstalling is often the only reliable way to see a change.
- Forgotten in-app routing. The app opens but shows a blank screen, so the link looks broken when only the handler is missing.
Tips
- Keep the association files in version control and deploy them like any other static asset so they cannot drift from the app code.
- Add a plain text or HTML page at the same paths as a web fallback. Even a simple "get the app" page beats a 404.
- On Android you can request a verification check from your development machine and read the result, which tells you immediately whether the file was fetched and parsed. iOS offers no equivalent command, so use the device logs or Apple's CDN-based check if your team uses one.
- Keep a checklist per release: fingerprints current, team ID correct, paths unchanged, new build installed, fallback page live.
- Do not rely on a link preview alone to judge behaviour. Tap the link from a real messaging app the way a user would.
Troubleshooting
The link always opens the browser. First confirm the association file loads in a fresh browser without redirects. Then check the package or bundle ID and the certificate or team ID for typos. Reinstall the app after any change, since both systems cache the result.
It worked before and stopped. Something changed: the file was moved, a certificate rotated, or Play App Signing replaced the signing key. Compare the live file against what the app expects.
It works on one device but not another. Look at the OS version, whether the app was installed from the store or side-loaded, and whether the user has previously chosen to open links in the browser for that domain. On iOS, a long press on a link can take over and open the browser on purpose.
The app opens on the wrong screen. Verification is fine and the handler is at fault. Log the incoming URL and compare it with your route table.
Nothing helps. After backing up anything you care about, delete the app and reinstall from the store, which clears cached verification state. If the problem survives that, the file on the server is still the likely culprit.
Frequently Asked Questions
Do I need both files?
Only if you ship on both platforms. Each system reads its own file; neither can use the other's.
Can one domain point to two apps?
Yes. Both formats allow multiple entries, typically split by path, so link A goes to app one and link B to app two.
Why does my link open the browser on an iPhone but work on Android?
The Apple file is usually missing, misnamed or unreachable, or the Associated Domains capability is not in the installed build.
Do these links work inside social media and email apps?
Sometimes. Many apps open links in their own in-app browser, which may ignore the app association. Test inside the specific app you care about rather than assuming.
Can I change paths later?
Yes, but update the hosted file and ship an app build that matches it. A file claiming paths the app cannot route produces dead ends.
Are these the same as custom URL schemes?
No. Schemes like myapp:// are taken by whichever app registers them first, which is insecure. App links and universal links tie the URL to a verified domain owner.