# How to build deferred deep linking in-house (and where teams get stuck)

> Thinking of building deferred deep linking yourself after Firebase Dynamic Links? The seven parts you'd need, the Android and iPhone traps we hit building our own, what it takes to run, and an honest look at when building in-house is the right call.

Source: https://straitlink.in/blog/build-deferred-deep-linking-in-house/

When Firebase Dynamic Links shut down on 25 August 2025, a lot of teams asked the same question: how hard can this be? A link that opens the app, and remembers itself through an install. A redirect server and a few lines in the app.

We had the same thought, and then built it. Strait is a deferred deep linking service, so this post is written by someone with a stake in the answer. We'll try to be useful anyway: here are the parts you'd build, the traps we hit on real phones, what it costs to keep running, and the cases where building in-house is the sensible choice.

## The seven parts

A deferred deep linking system that holds up in production has these parts. The first two are the ones people plan for.

| # | Part | What it does |
|---|---|---|
| 1 | Link server | Turns a short link into a decision for each tap |
| 2 | Verification files | `assetlinks.json` and `apple-app-site-association`, so the phone opens your app directly |
| 3 | Android hand-off | Gets a browser tap into the app, or to Google Play |
| 4 | Android deferred match | Carries the link through Google Play |
| 5 | iPhone deferred match | Reconnects an App Store install to its tap |
| 6 | App SDK | Receives links, runs the first-open check once, reports opens |
| 7 | Analytics and operations | Counts taps, opens and installs; keeps links safe and up |

Let's go through where each one gets hard.

## 1. The link server is a decision engine, not a redirect

A redirect is one line. The trouble is that a tap can come from very different places, and each needs a different answer:

- **A phone with your app**, where you want the app to open on the right screen.
- **A phone without it**, where you want the store (or your website) and the link kept for after install.
- **A desktop**, where you want the web page.
- **An in-app browser** (such as Instagram's or Facebook's), which often can't open your app or the store reliably. A plain redirect there can end up loading the store's web page inside the in-app browser. You need a page with a one-tap way out instead.
- **A link-preview robot**, which fetches the link when someone pastes it in a chat. It should get a page with Open Graph tags, never a redirect, and it must not be counted as a tap.

The robot case bit us. WhatsApp's preview fetcher and a real person in WhatsApp's web view both name WhatsApp in their user agent. The difference is the `Mozilla/5.0` prefix a browser sends. An early version of our engine counted real WhatsApp taps as robots until we split the two on that prefix. Our post on [opening your app from WhatsApp links](https://straitlink.in/blog/how-to-open-your-app-from-whatsapp-links/) shows the rule.

Each of these cases needs tests, and the list of user agents keeps changing. You can see how our engine classifies one with the [user agent inspector](https://straitlink.in/tools/ua-inspector/).

## 2. Verification files: small, and easy to get subtly wrong

Android App Links and iOS Universal Links let the phone open your app from an `https://` link with no browser at all. They need a file on your link domain listing your app.

On Android, the classic mistake is the SHA-256 fingerprint. Google Play re-signs your app with the Play App Signing key, so the copy people install has a different fingerprint from your debug and upload builds. Miss it and links quietly open the browser. Since Android 12, an unverified link opens the default browser instead of asking ([Android 12 behaviour changes](https://developer.android.com/about/versions/12/behavior-changes-all)). We list all three fingerprints; once the Play signing one was in our file, the Play-installed copy of our test app verified on its own. See [the SHA-256 mistakes that break App Links](https://straitlink.in/blog/android-app-links-verification-sha-256-mistakes/).

On iPhone, the file is fetched through Apple's CDN, which caches it, so a fix can take a while to show ([apple-app-site-association not working](https://straitlink.in/blog/apple-app-site-association-not-working-fixes/)).

The [App Links checker](https://straitlink.in/tools/app-links-checker/) fetches both files from any domain and explains what's wrong. You'll want something like it in your own release checklist.

## 3. The Android hand-off: every browser is a little different

When a tap lands in a browser on Android (the link wasn't verified, or it came through a web page), you hand it to the app with an `intent://` URL. Chrome documents the format, including a fallback URL for when the app isn't installed ([Chrome for Developers: Android Intents with Chrome](https://developer.chrome.com/docs/android/intents)).

Then you test other browsers. On our real-phone runs in October 2026:

- **Chrome** handed off cleanly, to the app or to Google Play.
- **Firefox** and **Edge** each showed a confirmation ("Open this link in…?") before opening the app. That's the browser's choice; you can't skip it.
- **Samsung Internet** opened the app from a tapped button, but when a link arrived without a user gesture (opened from another app with unverified links) it used the Play fallback even though the app was installed. Our [Samsung Internet post](https://straitlink.in/blog/samsung-internet-intent-link-opens-play-store/) has the details.

None of this is in a spec you can read once. You find it by tapping links on phones, then you keep finding it as browsers update.

## 4. The Android deferred match: the part Google made easy

Android is the good news. Put a link id in the `referrer` parameter of the Play Store URL, and the app can read it back after the install with Google's Install Referrer library. It's exact. The traps are around it rather than in it: encoding the referrer correctly, checking once per install, retrying when the phone is offline, and remembering that a sideloaded build has no referrer at all. Our [Play Install Referrer guide](https://straitlink.in/blog/play-install-referrer-deep-link-android/) walks through the code.

There's also a store trap: while your app isn't public, Play shows "Item not found" to anyone outside your testers. So your link server needs a rule for where not-installed Android taps go before launch. We added a workspace setting for exactly that.

## 5. The iPhone deferred match: the hard part

The App Store passes nothing from the tap to the app. Every option is a workaround:

| Approach | The catch |
|---|---|
| Clipboard: the page copies the link, the app reads it | iOS shows an "Allow Paste" prompt |
| Device match: page and app report coarse details, the server pairs them | Probabilistic, so you must design for mismatches |
| Ask the person: "continue where you left off?" | Extra friction |

If you build a device match, the engineering is the easy half. The rest is policy: which inputs you use, how long you keep them, what you write in your privacy policy and App Store privacy label, and what happens when two taps look alike. Our answer was a one-hour window, each entry matched once, and a refusal to match when two recent taps look alike, so nobody lands on someone else's screen ([How iPhone install matching works](https://straitlink.in/docs/iphone-install-matching/)). It's opt-in, proven on iPhone simulators, and the real-iPhone run waits on our App Store listing. That is how long the iPhone half takes to get right.

## 6. The app side: rules, not lines of code

The SDK is where small decisions decide whether users see the right screen:

1. **Run the deferred check once per install**, and mark it done only after the server answers.
2. **Let a real link win.** If the launch after install came from a link, skip the deferred jump.
3. **Give every open an id**, so a retry after a network error isn't counted twice.
4. **Queue reports that fail** and send them later, without making navigation wait.
5. **Ship it for every framework you use.** Native Android, iOS, React Native, Flutter: each needs the same behaviour, and the same tests.

We keep the matching rules in sync across our SDKs with shared test vectors, because drift between platforms was the bug we feared most.

## 7. Analytics and running it

Once links work, someone asks "how many installs did the WhatsApp campaign bring?" To answer, every tap needs an id that travels with the hand-off and the install, so the app's first open can be joined to it. Then you decide what counts: robots never, expired links never billed, installs only when the app opens (an install that's never opened is invisible to any SDK). Our [deep link analytics post](https://straitlink.in/blog/deep-link-analytics-taps-opens-installs/) describes one way to define it ([Analytics: how we count](https://straitlink.in/docs/analytics/)).

And then it has to stay up. Links get printed on boxes and sent in broadcasts, so a link server that is down breaks every link you ever shared. You'll want a fallback for when your database is unavailable, a way to change a link's destination without changing the link, and a way to disable a link someone abuses for phishing.

## So, should you build it?

Building in-house is reasonable when:

- **You only need Android**, and links come from places you control. App Links plus the Install Referrer is a contained project, and most of the time goes into testing on real phones.
- **You don't need deferred links on iPhone**, or you're happy with a clipboard prompt or an "enter your code" screen.
- **You have one app, one framework and a team** that will own link bugs for years, including the ones that appear when a browser or chat app updates.

It gets expensive when you need iPhone installs, in-app browsers, several frameworks, analytics marketing will trust, and links that must keep working after the person who built them leaves.

If you want to compare, Strait has a free plan ([pricing](https://straitlink.in/pricing/)), and the [cost calculator](https://straitlink.in/tools/cost-calculator/) shows what larger volumes cost. Either way, the [quick start](https://straitlink.in/docs/quick-start/) is a fast way to see the moving parts on your own phone before you decide.

## Sources and how we checked

- Android Developers, [Android 12 behaviour changes](https://developer.android.com/about/versions/12/behavior-changes-all): unverified links open the browser. Chrome for Developers, [Android Intents with Chrome](https://developer.chrome.com/docs/android/intents): the `intent://` format.
- Firebase, [Dynamic Links FAQ](https://firebase.google.com/support/dynamic-links-faq): the 25 August 2025 shutdown.
- The browser behaviour (Chrome, Firefox, Edge, Samsung Internet), the Play signing verification and "Item not found" are from our recorded real-phone tests in October 2026.
- The preview-robot fix is from our engine's change history. The iPhone match rules are from the engine's matcher and the [iPhone install matching](https://straitlink.in/docs/iphone-install-matching/) docs; iPhone matching has not been tested on a real iPhone yet.
