Expo deep linking that survives the install

Expo Router already turns URLs into screens. What it can't do alone is open the right screen after someone installs from the store, or count which chat the tap came from. This guide adds both.

Step 1 of 5How Expo handles links on its own

Expo Router maps the path of an incoming URL to a file in app/. A link to yourapp://product/42 opens app/product/[id].tsx without any code, and expo-linking gives you the raw URL if you want it. That covers links you control end to end, inside one app.

Three things are missing for links you share in public:

  • A link that works without the app. yourapp:// does nothing on a phone that doesn't have your app. A hosted link like https://hilltop.strait.link/summer sends people without the app to Google Play or the App Store instead.
  • The screen after install. Store installs lose the URL. The SDK gets it back: on Android from the Play Install Referrer, which is exact; on iPhone from a short-lived device match, which is opt-in.
  • Short links. https://hilltop.strait.link/summer means nothing to Expo Router, because /summer is a slug, not a screen. The SDK asks the link server for the destination and hands you its path.

The setup in four moves

The Expo page in the docs has every command; here is how the pieces relate.

  1. The same SDK as bare React Native. Install @straitlink/react-native plus AsyncStorage and the Play referrer helper with npx expo install, so their versions match your Expo SDK.
  2. app.json declares the link domain. The SDK's config plugin, ["@straitlink/react-native", { "domains": ["hilltop.strait.link"], "scheme": "yourapp" }], registers your custom scheme, an Android intent filter with autoVerify that claims hilltop.strait.link, and Associated Domains for the same host on iPhone. Prebuild writes them into the native projects.
  3. app/+native-intent.tsx steps aside. Expo Router would try to route /summer itself and show "Unmatched route". Returning '/' for your link domain lets the SDK's onLink callback do the routing instead, with the real destination path. If your screens live in src/app/, this file goes there too; Expo Router ignores an app/ folder next to src/app/.
  4. A development build. Expo Go can't load the SDK's native module, and links on your domain open your app, not Expo Go. npx expo run:android or an EAS development build fixes both.

Routing the event

app/_layout.tsx (excerpt)
return links.onLink((e) => {
  if (e.matched && e.path) router.push({ pathname: e.path, params: e.params } as Href);
});

Wait for useRootNavigationState()?.key before subscribing. onLink replays past events, so the launch link isn't lost while the navigator mounts.

EAS signing is the usual trap

Android only opens an app directly for a verified domain, and verification checks the SHA-256 fingerprint of the certificate that signed the build on the phone. Local builds use the debug keystore, EAS builds use the keystore eas credentials shows, and Play Store installs use the Play App Signing key. Each one you install needs its fingerprint in Dashboard → Apps & stores. When links work from npx expo run:android but not from an EAS build, this is almost always why.

What you get once it works

Each tap shows up in the dashboard with its channel (WhatsApp, Instagram, SMS), whether it opened the app or went to the store, and whether that install opened the right screen. Taps that start inside Instagram or WhatsApp get a page with an Open in app button first, because those browsers often don't pass the normal hand-off to your app.

Open the Expo docs

Ship links that open your Expo app.

Free for 25,000 taps a month, no card. Every tap gets a trace you can read.