The Modern Deep Linking Architecture: Custom Schemes vs Universal Links vs App Links
Mobile deep linking enables seamless routing from external websites, emails, or push notifications directly to specific in-app views. Traditional custom URL schemes (e.g., myapp://product/123) suffer from major security flaws: any malicious app installed on a device can register the identical scheme and intercept sensitive authentication tokens (scheme hijacking). To eliminate this vulnerability, Apple created Universal Links (iOS 9+) and Google created Android App Links (Android 6.0+). Both use standard HTTPS URLs backed by two-way cryptographic verification between the registered web domain and the native application.
// 1. Apple App Site Association (apple-app-site-association)
{
"applinks": {
"apps": [],
"details": [
{
"appIDs": ["9JA89QQLNQ.com.example.myapp"],
"components": [
{ "/": "/products/*", "comment": "Match all product pages" },
{ "/": "/auth/*", "exclude": true, "comment": "Do not deep link auth routes" }
]
}
]
}
}
// 2. Android Digital Asset Links (assetlinks.json)
[
{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.example.myapp",
"sha256_cert_fingerprints": [
"14:6D:E9:7C:F5:0A:D7:2F:3E:86:4F:9E:2B:1A:5C:3D:4E:6F:7A:8B:9C:0D:1E:2F:3A:4B:5C:6D:7E:8F:90:12"
]
}
}
]