Skip to content
useffect.sh
Book 30 min with a senior
UI

Deep linking

Opening a specific screen of the app from a URL: a custom scheme (myapp://) or a verified https link (universal links, App Links).

Definition

Deep linking means opening a React Native app directly on a given screen from a URL, whether from an email, a notification, a website, or another app. Two families coexist: custom URL schemes (myapp://order/42), which the OS routes to the app without verification but which do nothing when the app is not installed, and standard https links associated with the app through server-side proof (universal links on iOS, App Links on Android), which fall back to the website when the app is absent. In code, React Native’s Linking API covers two cases: Linking.getInitialURL() when the app is launched by a link, and the url event when it is already open. Expo Router makes every screen deep-linkable automatically; React Navigation needs a linking configuration. A push notification that opens the app on the home screen instead of the order it is about is a deep linking bug.

In a real app

In an Expo project, the custom scheme is declared with scheme in app.json, and prebuild injects it into Info.plist (CFBundleURLTypes) and into the intent filter in AndroidManifest.xml. Without prebuild, both edits are manual, plus forwarding to RCTLinkingManager in AppDelegate on iOS, or in SceneDelegate from React Native 0.88. On Android, android:launchMode="singleTask" on MainActivity avoids stacking a new app instance on every link.

Bugs cluster around the “app closed” case: the initial URL is read once, often before navigation is mounted, and a splash or authentication screen can swallow it. You need a single place that stores the pending URL, then navigates once the tree is ready. Expo Router handles this; with React Navigation, linking.getInitialURL and subscribe are the right hooks. Another classic: canOpenURL always returning false on iOS because the queried scheme is not listed in LSApplicationQueriesSchemes, and on Android 11 and later because the <queries> element is missing from the manifest.

To test: npx uri-scheme open myapp://order/42 --ios, or xcrun simctl openurl booted and adb shell am start -W -a android.intent.action.VIEW -d. I ask for a test matrix: custom link and https link, app closed, in the background, and in the foreground, on both platforms.

Sources

All 35 glossary terms

One of these is blocking your app?

30 minutes with a senior to look at the problem in your code. Free.