A Branch.io deeplink in Android, like a link from any link service, rests on two platform features: verified Android App Links, which open a URL straight in the app, and the Play Install Referrer, which carries a link through an install. Those two features decide whether links open reliably, whatever service or in-house code sits on top.
Startup founders and engineering leaders whose Android app opens patient screens from links in messages, emails or portals will find how verification works, how deferred deep links survive an install and what to check before a link shows any patient data.
How does a Branch.io deeplink work in Android?
A Branch.io deeplink in Android works like other link services: a verified Android App Link opens the app when it is installed, and otherwise the link's context is recovered after install through the Play Install Referrer or the service's own matching. Agnotic Technologies adds a sign-in and access check before any patient screen.
Opening patient screens from links?
We set up verified App Links, deferred links and the checks before any screen opens.
Android's developer documentation says that when an intent filter sets android:autoVerify to true, Android 6.0 and higher verify each host in the app's intent filters by fetching the Digital Asset Links file at https://hostname/.well-known/assetlinks.json.
What is the difference between a deep link, an App Link and a deferred deep link?
A deep link opens a screen inside an installed app, an App Link is a deep link on your own verified web domain, and a deferred deep link carries its destination through an install. Each behaves differently when the app is missing.
| Link type | Opens the app when | If the app is not installed |
|---|---|---|
| Custom scheme deep link | The app has registered the scheme | The link fails |
| Verified Android App Link | The domain is verified for the app | The URL opens in the browser |
| Deferred deep link | On first open after install | The user goes to the store, then lands on the screen |
Any app can register the same custom scheme, so a scheme link should never carry anything that matters. A verified App Link is tied to your domain and your app's signing certificate, which is why it is the right base for links that open sensitive screens.
How do you verify Android App Links?
Verify App Links by publishing a Digital Asset Links file on every domain the app handles, listing the package name and signing certificate fingerprint, and setting autoVerify on the intent filter. Then confirm the result on real devices.
- Publish assetlinks.json under /.well-known/ on every host in the intent filters, over HTTPS.
- List the SHA-256 fingerprint of the app signing key; with Play App Signing that is Google's key, not your upload key.
- Set autoVerify on intent filters with the VIEW action, the BROWSABLE and DEFAULT categories and an https scheme.
- Check each domain's state with adb shell pm get-app-links, which reports verified or a failure state per domain.
The same documentation says Android 15 and higher re-verify domains periodically, so a change to assetlinks.json can take up to seven days to reach all devices, while Android 14 and lower usually pick up changes only when the app is installed or updated. On Android 11 and lower, the app becomes the default handler only if every host verifies.
How do deferred deep links survive an install?
Deferred deep links survive an install by passing the link's context through the store, so the app can read it on first open and route the user to the screen they were sent to.
- Step 1, the user taps a link on a phone without the app, and the web page sends them to Google Play with a referrer parameter.
- Step 2, the user installs and opens the app.
- Step 3, on first open the app reads the install referrer once and parses the destination route.
- Step 4, the app sends the user to sign-in, and opens the destination only if the server confirms access.
Google's Play Install Referrer documentation says install referrer information is available for 90 days and does not change unless the app is reinstalled, and advises calling the API only once, the first time the app runs after install.
Link services add their own matching for cases the referrer does not cover, such as installs from other stores, but the checks after the app opens are the same whoever resolves the link.
What should be checked before a link opens a patient screen?
Before a link opens a patient screen, the app should confirm who is signed in, that this user may see that patient, and that the link is still valid. The link chooses a destination; it never grants access.
- Authentication: a signed-out user goes to sign-in first, and the destination is kept only as a route, never as data.
- Authorisation: the backend checks the signed-in user's access to the record before returning anything.
- Link validity: links carry an opaque, expiring token the backend resolves, not a raw record id.
- Fallback: an expired or unauthorised link opens a neutral screen that reveals nothing about the record.
What must never go in a deep link URL?
Patient names, birth dates, record numbers, diagnoses and any other PHI must never go in a deep link URL or its parameters. Links are stored in message histories, browser history, analytics and the logs of every service they pass through.
- Use an opaque token that maps to the destination on your own server.
- Expire tokens, and make them single-use where the workflow allows.
- Keep link parameters out of analytics events, or strip them before sending.
- Apply the same rule to links handled by a third-party link service, whose logs you do not control.
How do you test deep links before release?
Test every link path on real devices, because verification, routing and sign-in fail in ways an emulator with one test account will not show.
- Domain verification on a clean install for each supported Android version, including Android 11 and lower, where every host must verify.
- A deferred link through a real store install, not only a build installed from a developer machine.
- Signed-out, wrong-user and expired-token cases for every patient destination.
- Links opened from email, SMS and the patient portal, since each app hands links over differently.
Should you use a link service or build deep links in-house?
Build in-house when your installs come from Google Play and you need routing, not marketing attribution. Use a link service when you need attribution across channels and stores, and keep the security checks in your own app either way.
| Question | In-house App Links and referrer | Third-party link service |
|---|---|---|
| Installs from stores other than Google Play | Limited | Usually covered by its own matching |
| Campaign attribution and reporting | Built by you | Included |
| Where link data and logs live | Your systems only | Also with the vendor |
| Sign-in and access checks | In your app and backend | Still in your app and backend |
What are the common mistakes with deep links in Android?
The common mistakes with deep links in Android either break verification without anyone noticing or let the link do more than choose a screen.
- Listing the upload key fingerprint instead of the app signing key, so verification fails for store builds.
- Leaving a subdomain out of the files, which on Android 11 and lower stops the app becoming the default handler for any host.
- Putting record ids or names in link parameters.
- Opening the destination screen before sign-in completes.
- Reading the install referrer on every launch instead of once.
A worked example: an appointment reminder link
A clinic sends an SMS reminder with a link to the appointment details. The link holds an opaque token, not the appointment id.
A patient with the app installed taps it; the verified App Link opens the app, which asks for sign-in, resolves the token on the server and shows the appointment. A patient without the app goes to Google Play, installs, and on first open the app reads the referrer once, asks for sign-in and opens the same screen.
A link forwarded to a family member opens the app at sign-in. The server finds the token belongs to another account, and a neutral screen says the link is not available.
What do deep links mean for your build plan?
Deep links touch the website, the backend and the app, so plan them as one feature with one owner rather than a task in the mobile backlog.
- Decide which screens may be link destinations and which never are.
- Decide between a link service and in-house referrer handling, based on install sources and attribution needs.
- Plan the token service on the backend and its expiry rules.
- Own the domain files and add them to the release checklist.
How does Agnotic build deep links into Android apps?
Agnotic sets up verified App Links and the domain files, deferred link handling with the Install Referrer or the link service you choose, a token service on the backend, and the sign-in and access checks in front of every patient destination.
Links that choose a screen, never grant access
We build App Links, deferred routing and the checks in front of patient data.
Related reading on Agnotic
Mobile builds, payments and engineering practice.


