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 yourapp.json:
app.json
myapp:// to open your app.
Multiple schemes
app.json
Universal Links (iOS) and App Links (Android)
Universal links allow HTTPS URLs to open your app.- iOS - Universal Links
- Android - App Links
1
Configure app.json
app.json
2
Create apple-app-site-association file
Host this at
https://myapp.com/.well-known/apple-app-site-association:3
Find your Team ID
Handling Deep Links with Expo Router
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
Testing Deep Links
- iOS
- Android
- Expo Go
Debugging
Log all deep links
Test universal links validation
- iOS
- Android
Troubleshooting
Universal links not working
Universal links not working
- Verify your association files are accessible over HTTPS
- Check that the JSON is valid and properly formatted
- Ensure the Content-Type header is
application/json - Clear iOS cache: Delete app, restart device, reinstall
- For Android: Check SHA-256 fingerprint matches your app certificate
Links open in browser instead of app
Links open in browser instead of app
- On iOS: Universal links only work from external sources (Safari, Messages, Mail)
- Tapping links within your app’s WebView won’t trigger universal links
- Long-press the link and verify your app appears in the options
Parameters not being received
Parameters not being received
- 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
App not opening on custom scheme
App not opening on custom scheme
- 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
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