Android Deeplink
Deep linking
To create a link to your app content, add an intent filter with specific elements and attribute values to your manifest. The following XML snippet illustrates how you might specify an intent filter in your manifest for deep linking. Both the URIs "example://gizmos" and "http://www.example.com/gizmos" will resolve to this activity.
Note that the two intent filters only differ by the data
element. While it's possible to include multiple data
elements in the same filter, it's crucial to create separate filters when declaring unique URLs, such as a specific combination of scheme
and host
. This is important because multiple data
elements in the same intent filter are merged together to account for all variations of their combined attributes. For example, consider the following:
While it may seem that this supports only https://www.example.com
and app://open.my.app
, it actually covers those two as well as app://www.example.com
and https://open.my.app
.
After you've added intent filters with URIs for activity content to your app manifest, Android can route any Intent
with matching URIs to your app at runtime.
Once the deep link definitions are complete, if you import the following method into build.gradle
(app), users will be redirected to the deep link by the Netmera SDK when they click the notification. The Netmera SDK directs the user to the deep links defined in the manifest.
You can also obtain the deep link URI from the NMPushActionCallbacks
class.
For more detailed information on deep linking in Android, you can refer to the official Android documentation: Android Deep Linking
Universal Links
Configure the Project
Set android:autoVerify="true"
in one of the web URL intent filters in the app manifest that includes the android.intent.action.VIEW
intent action and android.intent.category.BROWSABLE
intent category.
Configure the website
Create an assetlinks.json
file with package_name
(the application ID declared in the app's build.gradle
file) and sha256_cert_fingerprints
(the SHA256 fingerprints of the app’s signing certificate).
Host the assetlinks.json
file. Publish the assetlinks.json
file on the domain. Ensure it is hosted on the website to indicate the association of Android apps with the website and to verify the app's URL intents.
Deeplink Callback
You can also retrieve the universal link URL from the NMPushActionCallbacks
class.
Last updated