Deep Link Builder
Build iOS Universal Links and Android App Links
Understanding Deep Links
Deep links allow you to take users directly to specific content within your mobile app from external sources like websites, emails, or other apps.
Types of Deep Links
1. Custom URL Schemes
The simplest form of deep linking, using a custom protocol:
- Format:
myapp://path/to/content - Pros: Easy to implement, works offline
- Cons: Not secure, prompts user, no fallback
- Use Case: App-to-app communication
2. iOS Universal Links
Apple's solution for seamless web-to-app deep linking:
- Format:
https://example.com/path - Pros: No prompts, fallback to web, secure
- Cons: Requires server configuration
- Use Case: Professional apps with web presence
3. Android App Links
Google's verified deep link solution:
- Format:
https://example.com/path - Pros: Verified, no disambiguation, secure
- Cons: Requires domain verification
- Use Case: Android apps with web equivalents
Universal Links (iOS) Setup
Requirements
- iOS 9.0 or later
- HTTPS domain you control
- Apple App Site Association (AASA) file
- Associated Domains entitlement
AASA File Format
{
"applinks": {
"apps": [],
"details": [
{
"appID": "TEAMID.bundle.id",
"paths": [
"/products/*",
"/user/*/profile",
"NOT /admin/*"
]
}
]
},
"webcredentials": {
"apps": ["TEAMID.bundle.id"]
}
}
Path Patterns
/path: Exact match/path/*: Wildcard matchNOT /path: Exclude path?*: Match query strings
Android App Links Setup
Requirements
- Android 6.0 (API 23) or later
- HTTPS domain you control
- Digital Asset Links file
- Intent filter with autoVerify
Getting SHA256 Fingerprint
# Debug keystore keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android # Release keystore keytool -list -v -keystore my-release-key.keystore
Testing Verification
# Check verification status adb shell dumpsys package domain-preferred-apps # Test statement list https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://example.com
Best Practices
URL Structure
- Keep URLs simple: Easy to type and remember
- Use meaningful paths:
/product/123not/p/123 - Support variations: Handle with and without trailing slashes
- Include IDs: Make links shareable and specific
Fallback Handling
- Always provide web fallback for universal/app links
- Show install prompt on web if app not installed
- Use smart banners (iOS) or app banners (Android)
- Track conversion from web to app install
User Experience
- Deep link to specific content, not just home screen
- Maintain context when switching from web to app
- Handle authentication gracefully
- Show loading states during deep link resolution
Common Issues
iOS Universal Links Not Working
- AASA file not accessible (check HTTPS, redirects)
- Wrong Team ID in AASA file
- Associated Domains not configured correctly
- Links clicked in same domain (long-press to open in app)
- Cache issues (uninstall/reinstall app)
Android App Links Not Verifying
- SHA256 fingerprint mismatch
- assetlinks.json not accessible
- Wrong package name in manifest
- autoVerify attribute missing
- Intent filter order matters
Debugging Deep Links
iOS
# Test AASA file curl -v https://example.com/.well-known/apple-app-site-association # Validate AASA https://search.developer.apple.com/appsearch-validation-tool/ # Check device logs Console.app → filter for "swcd"
Android
# Test assetlinks.json curl https://example.com/.well-known/assetlinks.json # Verify App Links adb shell pm verify-app-links --re-verify com.example.app # Check logs adb logcat | grep -i "IntentFilter"
Advanced Techniques
Deferred Deep Linking
Take users to specific content even on first app install:
- Store link data before app store redirect
- Retrieve and apply link after install
- Use services like Branch, Firebase Dynamic Links
Contextual Deep Links
Pass additional context with deep links:
- Campaign tracking parameters
- Referral information
- User preferences
- Authentication tokens (carefully!)
Comparison
| Feature | Custom | Universal/App |
|---|---|---|
| Setup | Easy | Complex |
| Security | Low | High |
| Fallback | No | Yes |
| Prompts | Yes | No |
Testing Checklist
- ✓ AASA/assetlinks.json accessible
- ✓ HTTPS configured correctly
- ✓ Content-Type is JSON
- ✓ App ID/package name correct
- ✓ Test on real devices
- ✓ Test with app installed
- ✓ Test without app installed
- ✓ Test fallback URL