# Deferred deep linking explained: how an app opens the right screen after install

> How an app opens the right screen after install. What deferred deep linking is, how Android carries the link through Google Play's install referrer, what iPhone can and can't do, and how to test it on a real phone.

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

## Answers

**Q: What is deferred deep linking?**
A: A deep link that survives an app install: someone without the app taps a link, installs from the store, and the first screen is the one the link pointed at.

**Q: How does it work on Android?**
A: The link service puts the link and tap ids in the Google Play URL’s referrer parameter; Google Play keeps it through the install and the app reads it once on first open. The match is exact.

**Q: Does it work on iPhone?**
A: Not exactly: the App Store passes nothing to the app, so services match coarse device details within a short window, read the clipboard (iOS shows a paste prompt) or ask the person. On Strait it is opt-in and proven on iPhone simulators so far.


A deep link opens your app on a particular screen: a product, an invite, a coupon. That works when the app is already on the phone. The hard case is the person who doesn't have your app yet. They tap the link, land in the app store, install, open the app, and see your home screen. The product they wanted is gone, and so is the reason they installed.

**The short answer:** deferred deep linking keeps a link alive through an app install. The tap is recorded before the store; on the app's first open, the SDK asks the link service which link brought this install and opens that screen. On Android, Google Play's install referrer carries the link exactly. On iPhone, the App Store carries nothing, so services match the device or use the clipboard.

This post explains how that works on Android and on iPhone, with diagrams, the code involved, and how to test it.

## Normal deep links vs deferred deep links

<figure class="blog-figure">
_Diagram: Two journeys after a tap. Without deferred deep linking, a tap goes to the store, then install, then the home screen. With it, the same journey ends on the product screen._
<figcaption>The journey is the same. The difference is whether the link survives the store.</figcaption>
</figure>

| Link type | App installed | App not installed |
|---|---|---|
| Plain deep link | Opens the screen | Store, then the home screen |
| Deferred deep link | Opens the screen | Store, then the link's screen on first open |

The first column is the job of Android App Links and iOS Universal Links, which let the phone open your app directly from an `https://` link. If you are unsure how those differ from custom schemes, our [guide to Universal Links, App Links and deep links](https://straitlink.in/blog/universal-links-vs-app-links-vs-deep-links/) covers it. The second column is deferred deep linking.

## How the app opens the right screen after install

The whole journey, in the order it happens on Android:

1. **The person taps the link.** The link service records the tap with an id and sees that the app isn't installed.
2. **The link service sends them to the store with the link attached.** On Android, the link id and tap id go into the `referrer` parameter of the Google Play URL.
3. **The person installs the app.** Google Play keeps the referrer string through the install.
4. **The app opens for the first time.** The SDK reads the install referrer once per install.
5. **The SDK asks the link service what that link points to.** The service answers with the path and parameters of the link that was tapped.
6. **The app routes to that screen.** Your code receives one link event, the same one an installed app gets from a normal tap, and opens the product, invite or coupon.

On iPhone, steps 2 to 4 have no carrier, so step 5 becomes a short-lived match instead of an exact lookup. The rest of this post explains both.

## Why the store is the hard part

The app store sits between the tap and the first open, and neither store was built to carry your link through. Your web server sees the tap. Your app sees the first open. Nothing in between knows they belong together, unless something carries the link across.

The two platforms give you very different tools for that:

- **Google Play** has an official carrier: the **Install Referrer**. Whatever you put in the `referrer` parameter of a Play Store link is kept through the install and can be read by the app.
- **The App Store** passes nothing from the tap to the app. Anything on iPhone is a workaround.

## Android: the Play Install Referrer

The Play Install Referrer API returns, among other things, the referrer string of the install, the time of the referring visit and the time the install began ([Android Developers: Play Install Referrer](https://developer.android.com/google/play/installreferrer)). That is enough for an exact match: put an identifier in the referrer and read it back on first open.

<figure class="blog-figure">
_Diagram: Android deferred deep link sequence. The phone taps the link. The link server sends it to Google Play with a referrer holding the link id and tap id. After install, the app reads the referrer, asks the server for the link, and opens the screen._
<figcaption>Android: the referrer is an exact carrier, so no guessing is involved.</figcaption>
</figure>

When someone without your app taps a Strait link on Android, the link server sends them to Google Play with the link and the tap attached:

```txt
https://play.google.com/store/apps/details?id=com.yourco.app&referrer=strait_link%3D<link id>%26strait_click%3D<tap id>
```

On first open, the app reads the referrer and asks the server what that link points to. If you were building this yourself, the reading half uses Google's library (`com.android.installreferrer:installreferrer:2.2` at the time of writing):

```kotlin
val client = InstallReferrerClient.newBuilder(context).build()
client.startConnection(object : InstallReferrerStateListener {
  override fun onInstallReferrerSetupFinished(responseCode: Int) {
    if (responseCode == InstallReferrerClient.InstallReferrerResponse.OK) {
      // e.g. "strait_link=lnk_…&strait_click=…" (or utm_ tags from a store ad)
      val referrer = client.installReferrer.installReferrer
      handleFirstOpen(referrer)
    }
    client.endConnection()
  }
  override fun onInstallReferrerServiceDisconnected() { /* retry on next launch */ }
})
```

Two rules make it reliable in practice:

1. **Run the check once per install.** Mark it done after the server has answered, so an offline first launch tries again next time instead of losing the install.
2. **Skip it when the first launch was itself a link.** If a verified link opened the app, that link wins, and a stale deferred jump must not follow it.

The Strait SDKs do both. The check runs once, is skipped (and marked done) when the first launch came from a link, and runs again on the next launch if the phone was offline ([Deferred deep linking docs](https://straitlink.in/docs/deferred-deep-linking/#once-per-install)).

If there is no referrer link (the app was found by searching the store, for example), there is nothing to match on Android, and that's the correct answer. The SDK still checks in once so the install counts toward your match rate.

### What we saw on a real phone

We tested this path end to end with a build distributed through a **Google Play internal testing** track: uninstall the app, tap the link in Chrome, land on the Play listing, install, open. The first screen was the link's screen (a coupon), the install was recorded with the method `install_referrer`, and reopening the app went to the home screen with no second jump.

The same test taught us the most common mistake: a sideloaded build, or one run from Android Studio, has no referrer. The app must come from Google Play. Internal testing counts.

## iPhone: no carrier, so a short-lived match

The App Store gives the app nothing about the tap. The options that exist all try to reconnect the two moments some other way:

| Approach | How it works | Trade-off |
|---|---|---|
| Clipboard | The web page copies the link; the app reads it on first open | iOS shows an "Allow Paste" prompt when an app reads the clipboard |
| Device match | The web page and the app both report a few coarse device and network details; the server pairs them within a short window | Probabilistic: two similar devices on one network can look alike |
| Ask the person | The app shows "Continue where you left off?" with a code or a search | Extra friction, but no guessing |

On iPhone, Strait uses a device match, and it is **opt-in**: it starts off until you turn it on. When someone without your app taps the link in Safari, they see a page with a **Get the app** button. That tap saves a short-lived match together with the link, then opens the App Store. On first launch, the SDK sends the same coarse fields, and if a saved entry from the last hour matches, the app gets the link. Each entry can be matched once and expires after an hour. When two recent taps look alike, the server refuses to match either of them rather than guess, so nobody lands on someone else's screen ([How iPhone install matching works](https://straitlink.in/docs/iphone-install-matching/)).

An optional clipboard boost gives an exact match when the person allows the paste. You choose device matching, the clipboard boost, both or neither in the dashboard, and the app picks up the choice without an update. iPhone matching is proven on iPhone simulators; the real-iPhone run waits on our App Store listing. That's why it's opt-in, and why each install in Analytics shows how it was matched.

## How to tell which method matched

Every install in Strait Analytics carries its match method:

| Method | Meaning |
|---|---|
| `install_referrer` | Exact, from the Google Play referrer |
| `exact_ext` | iPhone match on every input |
| `exact_core` | iPhone match on the core inputs |
| `clipboard` | iPhone clipboard boost, exact |
| `none` | No match: an organic install, or the window passed |

In the app, the link event says the same thing. In React Native, for example:

```ts
links.onLink((e) => {
  // First open after an install from a link:
  // e.kind === 'deferred', e.route === 'install_referrer' (Android)
  if (e.matched && e.path) openPath(e.path, e.params);
});
```

One callback covers both cases: a link that opened an installed app (`kind: 'direct'`) and a link tapped before install (`kind: 'deferred'`), so your routing code doesn't care which one happened.

## Testing deferred deep links

1. **Check the direct path first.** Verified App Links and Universal Links handle everyone who already has the app. The [App Links checker](https://straitlink.in/tools/app-links-checker/) fetches both verification files from your domain and explains what's wrong.
2. **Simulate the tap.** The [Will it open my app?](https://straitlink.in/tools/will-it-open/) simulator runs our decision code in your browser: pick Android or iPhone, set "app not installed", and see where the tap would go.
3. **Install from Google Play.** Upload a build to internal testing, uninstall, tap the link, install from Play, open. The step-by-step version is in [Test deep links in React Native](https://straitlink.in/docs/sdks/react-native/test/#4-test-a-deferred-link-first-open-after-install).
4. **Repeat after an uninstall.** The check runs once per install, so each new test needs a fresh install.

One more thing no linking product can measure: an install that is never opened. Until the app launches, nothing runs, so expect install counts from links to be lower than the store consoles' numbers ([Analytics: how we count](https://straitlink.in/docs/analytics/#what-no-one-can-measure)).

## Frequently asked questions

### What is deferred deep linking?

A deep link that survives an app install. Someone without your app taps a link, installs the app from the store, and the first screen they see is the one the link pointed at, not the home screen.

### How does deferred deep linking work on Android?

Through the Google Play Install Referrer. The link service puts the link and tap ids in the Play Store URL's `referrer` parameter, Google Play keeps it through the install, and the app reads it on first open. The match is exact.

### Does deferred deep linking work on iPhone?

Not exactly. The App Store passes nothing from the tap to the app, so services match coarse device details within a short window, read the clipboard (iOS shows a paste prompt), or ask the person. On Strait it is opt-in and proven on iPhone simulators so far.

### Why does my test install open the home screen?

Usually because the build didn't come from Google Play. A sideloaded build, or one run from Android Studio, has no install referrer. Install from a Play internal testing track instead, and uninstall before each test.

## Sources and how we checked

- Android Developers, [Play Install Referrer](https://developer.android.com/google/play/installreferrer) and [Play Install Referrer Library](https://developer.android.com/google/play/installreferrer/library): what the API returns, the Gradle dependency and the client calls in the Kotlin sample.
- The Play Store link format, the once-per-install rules and the match methods are from Strait's link engine and SDK code and its [deferred deep linking docs](https://straitlink.in/docs/deferred-deep-linking/).
- The Android result is from our real-phone test with a Google Play internal testing build (October 2026): uninstall, tap, install from Play, first open on the link's screen, method `install_referrer`.
- The iPhone match rules (one hour, single use, refuse when taps look alike) are from the engine's matcher and the [iPhone install matching](https://straitlink.in/docs/iphone-install-matching/) page. It has not been tested on a real iPhone yet.
