What Is Deep Linking?
Deep linking is the ability to direct users to specific content or screens inside your mobile app through a URL. Instead of just opening the app's home screen, a deep link takes the user exactly where they need to go, like a product page, a user profile, or a specific conversation.
Deep linking is essential for marketing campaigns, push notification actions, social media sharing, email engagement, and cross-app navigation.
Types of Deep Links
URI Scheme (Custom Scheme)
The simplest form. You register a custom URL scheme like myapp://product/123 in your app.
- Easy to set up
- Works only if the app is installed
- No fallback to web if the app is not installed
- Not unique. Any app can register the same scheme, causing conflicts
- Not recommended as the primary deep linking strategy
Universal Links (iOS)
Apple's modern deep linking system. Uses standard HTTPS URLs (e.g., https://yoursite.com/product/123) that open in your app.
- Requires a verified association between your domain and your app
- Falls back to the website if the app is not installed
- Unique: only your app can claim your domain
- More trustworthy: Apple verifies the domain-app relationship
App Links (Android)
Google's equivalent of Universal Links. Also uses HTTPS URLs.
- Requires a Digital Asset Links file on your web server
- Auto-verified by Android at install time
- Opens directly in your app without a disambiguation dialog
- Falls back to the browser if the app is not installed
Setting Up Universal Links (iOS)
1. Configure the Apple App Site Association (AASA) File
Host a JSON file at https://yoursite.com/.well-known/apple-app-site-association (no file extension):
The file specifies which URL paths your app handles. Apple's CDN fetches this file when the app is installed and periodically refreshes it.
2. Enable Associated Domains
In your Xcode project, add the Associated Domains capability and add your domain with the applinks: prefix: applinks:yoursite.com
3. Handle Incoming Links
In your AppDelegate or SceneDelegate, implement the method that receives the incoming URL and route the user to the correct screen.
Setting Up App Links (Android)
1. Host the Digital Asset Links File
Place a JSON file at https://yoursite.com/.well-known/assetlinks.json that declares the relationship between your website and your Android app (package name + signing certificate SHA-256).
2. Add Intent Filters
In your AndroidManifest.xml, add intent filters with autoVerify="true" for the URLs you want to handle.
3. Handle the Intent
In your activity, read the incoming intent data and navigate to the corresponding screen.
Deep Linking in Cross-Platform Frameworks
React Native (Expo Router)
Expo Router provides automatic deep link handling based on your file structure. Every route in the app/ directory is automatically a valid deep link path. For custom domains, configure the scheme in app.json and set up the AASA/assetlinks files on your server.
Flutter
Use the go_router package for declarative deep link handling. Flutter supports both Universal Links and App Links through platform-specific configuration in your ios/ and android/ project files.
Deferred Deep Linking
Regular deep links only work when the app is already installed. Deferred deep linking preserves the intended destination through the installation process:
- User taps a link (https://yoursite.com/invite/abc)
- App is not installed, so the user goes to the app store
- User installs the app
- On first launch, the app opens directly to the invite screen
Implementing deferred deep linking typically requires a third-party service (Branch, AppsFlyer, Firebase Dynamic Links) that stores the link context and matches it after installation using fingerprinting or clipboard techniques.
Note: Firebase Dynamic Links was deprecated in 2025. Branch and AppsFlyer are the primary alternatives.
Testing Deep Links
- iOS: Use the command xcrun simctl openurl booted "https://yoursite.com/path" to test in the simulator
- Android: Use adb shell am start -a android.intent.action.VIEW -d "https://yoursite.com/path"
- Expo: Use npx uri-scheme open for development testing
- Validate your AASA file at Apple's search tool
- Validate assetlinks.json with Google's Digital Asset Links testing tool
Common Pitfalls
- Forgetting to serve the AASA file with the correct Content-Type (application/json)
- AASA file not accessible without redirects (Apple requires direct access)
- Mismatched Team ID or Bundle ID in the AASA file
- Not handling the case where the link opens the app but the target content requires authentication