Skip to main content

Deep Linking

Expo Router provides automatic deep linking for all routes. Every route you create is automatically accessible via deep links on all platforms.

How Deep Linking Works

Expo Router automatically creates deep link patterns for every route:
From the source (linking.ts:18-22):

Scheme Configuration

Set Your Scheme

Configure your app’s URL scheme in app.json:
app.json
This creates the scheme:
  • iOS: myapp://
  • Android: myapp://
  • Web: https://yourdomain.com/

Multiple Schemes

Support multiple URL schemes:
app.json
Universal links allow your app to open using regular HTTPS URLs. Configure in app.json:
app.json
Create apple-app-site-association file at https://myapp.com/.well-known/apple-app-site-association:
Configure in app.json:
app.json
Create assetlinks.json at https://myapp.com/.well-known/assetlinks.json:

iOS Simulator

Android Emulator

Physical Devices

Send yourself a message or email with the link:
Tap the link to test.

Development Testing

In Expo Go during development:

Automatic Handling

Expo Router handles deep links automatically:
app/profile/[id].tsx
Deep link: myapp://profile/123
Result: id = "123"

Initial URL

Handle the initial deep link that opened the app:
app/_layout.tsx
Listen for deep links while app is running:
app/index.tsx

Query Parameters

Deep links can include query parameters:
app/search.tsx

Dynamic Routes

Dynamic routes work automatically with deep links:
app/posts/[id].tsx
Deep links:
  • myapp://posts/123{ id: '123' }
  • myapp://posts/abc-def{ id: 'abc-def' }

Redirects

Redirect deep links to different routes:
app/_layout.tsx

Authentication

Handle authentication with deep links:
app/_layout.tsx
app/(auth)/login.tsx
Protected route redirects to login with return path:

Custom Scheme Handling

Handle custom URL schemes:
app.json

Native Intent (Android)

Create custom native intent handling:
app/+native-intent.ts

Debugging

Log All Navigation

app/_layout.tsx

View Route Tree

In development, visit /_sitemap to see all routes:

Common Patterns

Email Verification

app/verify-email.tsx
Deep link: myapp://verify-email?token=abc123

Password Reset

app/reset-password.tsx
Deep link: myapp://reset-password?token=xyz789
app/index.tsx
Deep link: myapp://?ref=friend123

Best Practices

Use Descriptive Schemes

Handle Missing Parameters

Test on All Platforms

Test deep links on:
  • iOS Simulator
  • Android Emulator
  • Physical iOS device
  • Physical Android device
  • Web browser

Next Steps

Dynamic Routes

Handle dynamic deep link parameters

Typed Routes

Type-safe deep link navigation

Navigation

Navigate to deep link routes

API Routes

Create deep linkable API endpoints