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:linking.ts:18-22):
Scheme Configuration
Set Your Scheme
Configure your app’s URL scheme inapp.json:
app.json
- iOS:
myapp:// - Android:
myapp:// - Web:
https://yourdomain.com/
Multiple Schemes
Support multiple URL schemes:app.json
Universal Links
Universal links allow your app to open using regular HTTPS URLs.iOS Universal Links
Configure inapp.json:
app.json
apple-app-site-association file at https://myapp.com/.well-known/apple-app-site-association:
Android App Links
Configure inapp.json:
app.json
assetlinks.json at https://myapp.com/.well-known/assetlinks.json:
Testing Deep Links
iOS Simulator
Android Emulator
Physical Devices
Send yourself a message or email with the link:Development Testing
In Expo Go during development:Handling Deep Links
Automatic Handling
Expo Router handles deep links automatically:app/profile/[id].tsx
myapp://profile/123Result:
id = "123"
Initial URL
Handle the initial deep link that opened the app:app/_layout.tsx
Listening for Deep Links
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
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
Preserve Deep Link Destination
app/(auth)/login.tsx
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
Test Deep Link Parsing
View Route Tree
In development, visit/_sitemap to see all routes:
Common Patterns
Email Verification
app/verify-email.tsx
myapp://verify-email?token=abc123
Password Reset
app/reset-password.tsx
myapp://reset-password?token=xyz789
Referral Links
app/index.tsx
myapp://?ref=friend123
Share Links
Best Practices
Use Descriptive Schemes
Handle Missing Parameters
Validate Deep Link Data
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