Skip to main content

Overview

Deep linking allows external URLs to open specific screens in your app. Expo Router provides built-in support for deep linking with automatic route matching.

URL Schemes

Configure your scheme

Add a URL scheme to your app.json:
app.json
This allows URLs like myapp:// to open your app.

Multiple schemes

app.json
Universal links allow HTTPS URLs to open your app.

Automatic route matching

Expo Router automatically handles deep links based on your file structure:

Access URL parameters

app/products/[id].tsx

Handle query parameters

Advanced Deep Linking

Programmatic navigation

Custom URL parsing

Deferred deep linking

Handle deep links after authentication:
app/_layout.tsx

Using xcrun

Using Safari

Open Safari on your simulator/device and enter the URL in the address bar.

Using Notes app

  1. Open Notes app
  2. Create a new note
  3. Type your deep link URL
  4. Tap the link

Debugging

Test your apple-app-site-association file:
Or use Apple’s validator.

Troubleshooting

  • Check that you’re using useLocalSearchParams() from expo-router
  • Verify the URL is properly formatted with query parameters
  • Log the received URL to inspect its structure
  • Rebuild your app after changing the scheme in app.json
  • Verify the scheme doesn’t conflict with other apps
  • Check for typos in your URL scheme
Changes to URL schemes and associated domains require a rebuild. Run npx expo prebuild and rebuild your app.

Best Practices

  • Use universal links in production: They provide a better user experience than custom schemes
  • Handle missing parameters gracefully: Not all deep links will include all expected parameters
  • Validate deep link data: Don’t trust user-provided data in URLs
  • Support both authenticated and unauthenticated routes: Store deep links if authentication is required
  • Test on physical devices: Universal links don’t work reliably in simulators
  • Use analytics: Track which deep links drive the most engagement
  • Provide fallbacks: Handle cases where the linked content no longer exists
  • Document your URL structure: Maintain a clear mapping of URLs to app screens