Implementing Deeplink will help improve user experience in native application. E.g. when you have a nice native app and a product link on the web can be only seamlessly in the native mobile app for better illustration.
- Adjust => tracking attribution platform
- branch.io => full service around linking
Identifier such as myapp
will enable resourse location like myapp://product/1?action=edit
, however not by default,
setup is still required.
This identifier is called custom url scheme and can be registered arbitrarily, meaning any application can add as many
custom url schemes as possible, therefore it make sense to have reversed domain name as prefix.
iOS provides some basic url schemes such as
mailto
open default mail applicationtel
open phone to dial
One has to register a custom url scheme to be able to receive the it.
Note: using a custom url scheme that doesn't exist will error out
UL solves the challenge to map a web url to app url, I.e.
www.example.com/product/1
=> applinks://product/1
One of the challenge doing that is to establish ownership of the domain to your app, otherwise random app can just steal the traffic of a popular domain/website. Imagine an app map all facebook.com/*
to its own app without some sort of authentication
The way iOS and Android solves it is by asking the website to provide prove of the ownership of the domain/website in form of json
file, and furthermore the content of the file define the exact behaviour of deeplink
- iOS:
https://domain.want.to.support.deeplink/apple-app-site-association
=> return json - Android:
https://domain.want.to.support.deeplink/.well-known/assetlinks.json
=> return json
iOS example
{
"applinks": {
"apps": [], // must be here
"details": [
{
"appID": "RUSM5GM327.de.myapp.nxt", // teamId.bundleId
"paths": [
"/*"
]
}
]
}
}
In order to support custom url on Android, AndroidManifest.xml
file has to be modified as such
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https" android:host="link.example.com" />
<data android:scheme="myapp" android:host="open" />
</intent-filter>
Use the following testing command in cli
# Note: the & has to be prepended with "\"
adb shell am start \
-W -a android.intent.action.VIEW \
-d "myapp://open?s=param1\&otherParam=param2" bundleId
Here list some points help testing deeplink
- Android and iOS requires recompilation to test
- universal link on iOS is connected with bundle identifier, and team Id.
- spawn a local server with some
<a/>
tags speeds up testing
<a href="myapp://">Link to App via myapp://</a>
<br><br><br><br>
<a href="https://universal.link">Universal link test</a>
python3 -m http.server 8000
- https://medium.com/@ageitgey/everything-you-need-to-know-about-implementing-ios-and-android-mobile-deep-linking-f4348b265b49
- https://medium.com/wolox/ios-deep-linking-url-scheme-vs-universal-links-50abd3802f97
- https://blog.branch.io/deep-linking-from-url-and-uri-schemes-to-universal-links-app-links-and-beyond/
- https://developer.android.com/training/app-links/deep-linking