Deferred deep links in Expo, end to end
After this guide, someone who taps your link without your Expo app installed goes through Google Play and lands on the link's Expo Router screen on the first launch, and you can see that tap, install and open in Analytics.
On this page 9
- Time
- About 45 minutes of work, plus an EAS build and the first Google Play review (up to 7 days, per Google)
- You need
- An Expo SDK 51+ app using Expo Router, an EAS account, a Strait workspace with your app in Apps & stores, a Google Play developer account, an Android phone
- Works on
- Android. iPhone uses the same code.
This page strings the Expo and React Native pages into one path for the case that matters most to growth teams: a new user. Expo uses the same SDK as bare React Native; what changes is app.json, a development build instead of Expo Go, and EAS for the Play build. Bare React Native? Use the React Native recipe.
1. Make a link for one screen
In Dashboard → Links → New link, set the slug summer and the destination https://shop.example.com/product/42?ref=SUMMER. Or from your server:
curl https://strait.link/v1/links \
-H "Authorization: Bearer $SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "slug": "summer", "longUrl": "https://shop.example.com/product/42?ref=SUMMER", "campaign": "summer_2026" }'Your app receives the destination's path and query (/product/42, { ref: 'SUMMER' }), so use paths that match files in app/, here app/product/[id].tsx.
You should see: the link https://hilltop.strait.link/summer in the Links list.
2. Install the SDK and add app.json settings
On Android, the link travels through the install inside the Google Play Install Referrer. The SDK reads it once you pass the referrer module:
npm install @straitlink/react-native@0.11.6
npx expo install @react-native-async-storage/async-storage react-native-play-install-referrerCreate links.ts exactly as for bare React Native: its installReferrer line is what carries the link through Google Play. Set android.package and add the SDK's config plugin to app.json with your link domain and scheme, as in Expo, step 2; it writes the intent filter, Associated Domains and scheme at prebuild.
You should see: npx expo config --type prebuild prints your scheme and an intentFilters entry with "autoVerify": true, and the SDK is in package.json.
3. Route every link, including the deferred one
The deferred link arrives through the same onLink callback as any other link, once, on the first launch after the install. onLink replays events from before you subscribed, so subscribing when navigation is ready never misses it:
import { Stack, router, useRootNavigationState, type Href } from 'expo-router';
import { useEffect } from 'react';
import { links } from '../links';
export default function RootLayout() {
const ready = useRootNavigationState()?.key;
useEffect(() => {
if (!ready) return;
return links.onLink((e) => {
if (e.kind === 'deferred') console.log('Strait first open:', e.route, e.matched, e.reason);
if (e.matched && e.path) router.push({ pathname: e.path, params: e.params } as Href);
});
}, [ready]);
return <Stack />;
}Add app/+native-intent.tsx from Expo, step 3 so Expo Router doesn't try to open the raw link URL itself. Then make a development build, because Expo Go can't load the native module: npx expo run:android.
If your screens live in src/app/ (new create-expo-app projects), put _layout.tsx and +native-intent.tsx in src/app/ and links.ts in src/. Expo Router ignores an app/ folder next to src/app/.
You should see: adb shell am start -W -a android.intent.action.VIEW -d "yourapp://shop.example.com/product/42" opens app/product/[id].tsx with id 42, and no "Unmatched route" screen. This proves the routing; the next steps prove the install.
4. Decide what a new user sees first
On the first launch the SDK always answers once with kind: 'deferred'. When matched is false, reason is no_match (most installs don't come from a link) or network (the check runs again on the next launch). Show your usual onboarding in both cases, and skip it when a link matched:
import { links } from './links';
// The link's path for a new user who came from a link, or null.
// Later launches have no deferred event, so the timer answers null.
export const firstOpenPath = new Promise<string | null>((resolve) => {
const timer = setTimeout(() => { off(); resolve(null); }, 5000);
const off = links.onLink((e) => {
if (e.kind !== 'deferred') return;
clearTimeout(timer);
off();
resolve(e.matched && e.path ? e.path : null);
});
});Keep the splash screen up while you wait (expo-splash-screen's preventAutoHideAsync, then hideAsync).
You should see: a fresh development-build install, with no link tapped, logs Strait first open: fingerprint false no_match and shows your onboarding.
5. Ship a Google Play internal-testing build
A development build has no install referrer, so this test needs a build installed from Google Play:
- Run
eas build --platform android --profile productionand upload the.aabto internal testing in Play Console (by hand, or witheas submit --platform android). Add yourself as a tester. - In Dashboard → Apps & stores → People without the app, choose Always Google Play while the app isn't public. (The default sends people to your website while the Play listing isn't live.)
You should see: the build listed as available to testers in Play Console. Google says the first review can take up to 7 days, or longer in exceptional cases (Play Console Help).
6. Tap, install, open
- Uninstall the app from the phone.
- Send yourself
https://hilltop.strait.link/summerin WhatsApp or Messages and tap it. Google Play opens on your app. - Install from Play and open the app.
You should see: the app opens directly on the Product screen for 42, with ref SUMMER in its params, and adb logcat | grep ReactNativeJS shows Strait first open: install_referrer true. The check runs once per install; uninstall to repeat it.
7. See the install in Analytics
Open Dashboard → Analytics and choose summer_2026 in the Campaign filter. To put revenue on the same tap, record a purchase from the app with links.trackEvent('purchase', { value: 499, currency: 'INR' }) (Events & revenue).
You should see: your tap on summer, one install with match method install_referrer joined to that exact tap, and one app open from a new user. A test purchase appears under the same campaign.
Common errors
- The first open lands on the home screen. The app came from a development build or a shared APK, not Google Play, or the Apps & stores choice in step 5 still sends people to your website.
- "Unmatched route" after the install.
app/+native-intent.tsxis missing, so Expo Router tried to open/summeritself (step 3). - Verified links open the browser in the Play build. The Play App Signing key isn't in Apps & stores. Add it as in Expo, step 5.
Next steps
- Go-live checklist: verified links, iPhone and keys before real users tap.
- Test mode: check the deferred wiring from a debug build in two minutes, without a Play upload.