React Native · Mobile UI at native speed

How do you implement deep linking?

Mediumdeep linkslinkingnavigationUpdated Oct 2026
Quiz this track

Short answer

Define a URL scheme and universal or app links, map URLs to screens in the navigation linking config, and handle the initial URL plus runtime URL events. Validate params before acting on them.

A deep link opens a specific screen from outside the app, such as an email, an ad or another app. There are two levels: a custom scheme such as myapp://, and verified links using universal links on iOS and app links on Android, which use https URLs.

tsx
import { NavigationContainer, LinkingOptions } from "@react-navigation/native";

const linking: LinkingOptions<RootStackParamList> = {
  prefixes: ["myapp://", "https://example.com"],
  config: {
    screens: {
      Home: "",
      Detail: "items/:id",
      Profile: "users/:userId",
    },
  },
};

export function App() {
  return (
    <NavigationContainer linking={linking}>
      <RootNavigator />
    </NavigationContainer>
  );
}
The linking config turns paths into routes and extracts params such as id.

Checklist for reliable links

  • Register the scheme in Info.plist and the intent filter in AndroidManifest
  • Host apple-app-site-association and assetlinks.json for verified links
  • Handle getInitialURL for cold starts and the url event for warm starts
  • Parse and validate params, especially ids and redirect targets
  • Test links with the app killed, backgrounded and already open

Authentication complicates deep links. If a link targets a protected screen, store the intended destination, send the user through login, then navigate after success. Do not navigate before the session is ready, or the guard will bounce the user back.

Treat deep link params as untrusted input. A redirect parameter that accepts arbitrary URLs is an open redirect, and an unvalidated id can expose another user's data.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1What is the difference between a URL scheme and a universal link?
  2. 2How do you handle a deep link when the app is cold started?
  3. 3How do you preserve the destination through login?
  4. 4What security checks does a deep link need?

Say it in the interview

I define a scheme and verified https links, map paths to screens in the navigation linking config, and handle both the initial URL and runtime URL events. For protected screens I hold the destination until authentication finishes, then navigate. I validate every param, because a deep link is untrusted input that can otherwise cause open redirects or data leaks.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live React Native mock interview and get scored feedback on depth, clarity and confidence.