October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Deep Linking in React Native: Practical Implementation

A practical guide to React Native deep linking, from native URL delivery and React Navigation path mapping to platform association and installed-build testing.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To make a React Native deep link work end to end, configure the operating system to deliver the URL, then map that URL to navigation state and validate its data. Handle both cold starts, when the link launches the app, and links received while the app is already running. For links intended to work from email or a browser and have a website fallback, use HTTPS Universal Links on iOS and verified Android App Links; custom schemes can complement them for app-specific use.

Choose URL shapes before configuring the app

Start with stable, readable routes such as https://app.example.com/records/123. Decide which paths are shareable, which require sign-in, and what the website should display if the app does not open. Keep route design compatible with links already shared; changing a path later can break old links unless the site or app handles the old form.

As an Amazon Associate I earn from qualifying purchases.

Do not put secrets or authorization decisions in a URL. A path or query parameter can identify a requested record, but it cannot establish that the person opening the link is allowed to access it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose HTTPS links, a custom scheme, or both

Option Can also be a website URL? Association setup Behavior if the app is absent Best fit
Custom URI scheme, such as myapp://records/123 No; it is an app-specific scheme, not a normal HTTPS page. Register the scheme in the app. It does not provide the same website-owned HTTPS association as platform links. A website fallback is not inherent to the scheme; behavior depends on the caller and platform. App-specific opening or app-to-app use.
HTTPS Universal Links (iOS) and Android App Links Yes. The URL remains a normal web address. Associate the app with the website: configure iOS Associated Domains and its website association document; configure Android intent filters and publish the Digital Asset Links association file. The website can provide a browser destination, depending on its configuration and platform behavior. Shareable links that should work across app and web contexts.

The platform documentation describes the association model and potential web behavior, not a universal fallback guarantee. Test the actual domain and installed app on both platforms. Many applications support HTTPS links for sharing and a custom scheme where app-specific integration calls for it. [Apple Universal Links documentation; Android App Links documentation]

Handle links on cold start and while the app is open

React Native exposes two delivery cases through its Linking API: the initial URL that launched the app, and a url event delivered while the app is active. If you implement URL handling yourself, cover both cases. A navigation library’s linking integration can coordinate them.

  • Linking.getInitialURL() retrieves the URL associated with launching the app.
  • Linking.addEventListener('url', callback) subscribes to URLs received while the app is running.

React Native’s guidance documents both flows and the platform handoff needed to receive URLs. Native project details can vary by template and version; consult the documentation for the React Native version and native project in use before changing forwarding code. On Android, React Native notes that MainActivity may use launchMode="singleTask" when an existing activity should receive the intent. [React Native Linking]

Map paths to React Navigation screens

Use React Navigation’s linking configuration to declare supported prefixes and translate URL paths into navigation state. It uses React Native’s Linking module on mobile and also supports web URL integration where applicable. Its documentation advises against routing deep links yourself through a navigation ref because that can be error-prone and more complicated. [React Navigation: Deep linking; React Navigation: Configuring links]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A configuration conceptually includes prefixes such as https://app.example.com and, if needed, myapp://, plus a path map for screens. Nested navigators require paths that reflect the intended screen hierarchy; parameter parsing may be needed when a path segment or query value must become a typed route parameter. Follow the syntax for the installed React Navigation version rather than copying an unversioned snippet.

Treat the link configuration as part of your route contract. Define what happens when an identifier is missing or malformed, and what a signed-out user sees when a destination requires authentication. These are application decisions, not behavior guaranteed by URL mapping alone. [React Navigation: Configuring links]

Configure the native platforms and website

iOS: Universal Links

Enable the Associated Domains capability and configure the app’s entitlement for the relevant domain using the applinks: service. The website must also host the association document that connects the domain to the app. Apple’s description of Universal Links is that they link directly to app content and share data securely; the working association involves both the app and the website. [Apple Universal Links documentation]

Android: App Links

Declare an HTTPS VIEW intent filter with the appropriate categories and host. For verified App Links, publish the Digital Asset Links association file on the website and configure verification as required for the target SDK. Confirm current manifest syntax and verification behavior against Android’s documentation, since platform requirements evolve. [Android App Links documentation]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Expo and bare React Native projects

Expo projects express platform configuration in app configuration, including iOS associatedDomains and Android intentFilters; domain association files are still needed on the website. Bare React Native projects make corresponding changes in their native platform projects. React Navigation’s Expo example illustrates the configuration approach, but use the setup applicable to your Expo SDK and workflow. [React Navigation: Deep linking]

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Validate incoming links before acting on them

A deep link carries externally supplied data into the app. Validate the URL’s expected scheme or domain, route, identifiers, and parameters before using them. Then enforce authorization against the actual account and requested resource; navigating to a screen must not itself grant access. Define safe behavior for unknown routes and malformed values, and avoid letting a crafted link trigger sensitive actions without appropriate checks. [React Native security]

Test the installed app on both platforms

  1. After changing schemes, entitlements, intent filters, or associated domains, rebuild and install the native app. React Navigation specifically cautions that deep-link testing requires a rebuilt installed app. [React Navigation: Deep linking]
  2. Open a representative link with the app fully closed and verify that it launches to the expected destination.
  3. Open the app first, then deliver another link and confirm that the running app responds correctly.
  4. Try valid, missing, malformed, and unexpected parameters. Confirm each produces the intended screen or a safe fallback rather than an unintended route or action.
  5. Test HTTPS association separately on iOS and Android, and check the website destination when the app is unavailable. Domain association and fallback behavior depend on the platform and site configuration.
  6. Confirm that only intended schemes and domains are accepted, and that all link-provided data is validated before use.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.