Test deep links in React Native
After this page, you've seen each kind of link open your app on a real phone, and you know which tools tell you why when one doesn't.
On this page 7
- Time
- About 15 minutes, plus a Google Play internal testing build for deferred links
- You need
- Links routed to screens (Receive links), an Android phone with USB debugging
- Works on
- Android, iPhone
1. Test the routing without a tap
adb hands your app a URL exactly as the phone would, so you can check routing before anything else:
# Browser hand-off (custom scheme)
adb shell am start -W -a android.intent.action.VIEW -d "yourapp://shop.example.com/product/42?color=red"
# Verified link (needs App Links verified: go-live checklist, step 2)
adb shell am start -W -a android.intent.action.VIEW -d "https://hilltop.strait.link/summer"You should see: the Product screen for 42, with color red in its params. Run each command once with the app closed and once with it in the background.
2. Tap a real link from a chat app
Send https://hilltop.strait.link/summer to yourself in Google Messages, Gmail and WhatsApp, and tap it in each. Phones only open apps from links that are tapped, never from the address bar.
You should see: the app opens on the link's screen. In WhatsApp or Instagram you may see an Open in app page first: in-app browsers often don't open apps on their own, so we show a page with an Open in app button and steps to open the link in the real browser.
3. Ask what a tap would do, without tapping
GET /v1/simulate runs the same decision a real tap gets, for any device, without recording a tap:
curl "https://strait.link/v1/simulate?url=https%3A%2F%2Fhilltop.strait.link%2Fsummer&ua=whatsapp-android" \
-H "Authorization: Bearer $SECRET_KEY"Presets for ua: android, iphone, ipad, desktop, instagram-ios, instagram-android, facebook-android, whatsapp-android, bot. Dashboard → Playground runs the same check.
You should see: a decision, the location the phone would be sent to, and a plain-English reason. See Dry-run a tap.
4. Test a deferred link (first open after install)
On Android the link travels through the Google Play Install Referrer, so the app must be installed from Google Play. Internal testing is fine; a sideloaded build has no referrer. Set up internal testing once (go-live checklist, step 3), then:
- Uninstall the app.
- Tap
https://hilltop.strait.link/summeron the phone. Google Play opens. - Install from Play and open the app.
You should see: the app's first screen is the link's screen, and the event logged in step 4 of Install & set up has kind: 'deferred' and route: 'install_referrer'. The check runs once per install: uninstall again to repeat it.
5. Check reports and re-run the deferred check
import { links } from './links';
console.log('waiting to send:', await links.pendingOpenReports()); // opens saved while offline
await links.flushOpenReports(); // send them now
const e = await links.checkDeferred(); // re-run the deferred check
console.log(e.kind, e.matched, e.reason, e.path);checkDeferred() never records an install and doesn't touch the once-per-install flag, so it's safe to call while you debug.
You should see: waiting to send: 0 when the phone is online, and the same answer from checkDeferred() that the first launch got.
Common errors
- Deferred test opens the home screen. The app came from Android Studio, not Play, or "When someone without the app taps a link" isn't Always Google Play while the app is unlisted.
- Verified link opens the browser. The installed build's certificate isn't in Apps & stores. Go-live checklist, step 1.
- Works in Messages, not in Instagram. Expected: Instagram's in-app browser often doesn't hand links to apps; the Open in app page is the way out. More in Troubleshooting.
Next steps
- Go-live checklist: everything to finish before real users tap your links.
- Reference: every option, method and event field.