Deep Linking
Deep Links
Step 1: Add Intent Filters to Your Manifest
Add intent filters to your app's manifest file to define the URLs or URIs your app can handle. This configuration allows both example://gizmos
and http://www.example.com/gizmos
to open the same activity in your app.
Step 2: Avoid Merging Data Elements in Intent Filters
When defining multiple data elements in the same intent filter, Android merges their attributes, which can lead to unintended behavior. For example:
This configuration will match:
https://www.example.com
app://open.my.app
app://www.example.com
https://open.my.app
To avoid this, use separate intent filters for unique URL schemes and hosts.
Step 3: Enable Netmera SDK for Deep Link Handling
To allow the Netmera SDK to handle deep links automatically, add the following configuration to your build.gradle (app)
file:
Step 4: Retrieve Deep Link URI in Your App
To access the deep link URI programmatically, use the NMPushActionCallbacks
class provided by the Netmera SDK:
For more detailed information on deep linking in Android, you can refer to the official Android documentation:
Android Deep Linking Documentation
For more detailed information on deep linking in Android, you can refer to the official Android Deep Linking documentation.
Universal Links
Step 1: Configure the Project
Set android:autoVerify="true"
in one of the web URL intent filters in your app manifest. This enables Android to verify the link association with your website.
Step 2: Configure the Website
Create an
assetlinks.json
file with the following details:
package_name
: The application ID declared in your app'sbuild.gradle
file.sha256_cert_fingerprints
: The SHA256 fingerprints of your app’s signing certificate.
Host the
assetlinks.json
file and publish theassetlinks.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 Callbacks
You can retrieve the universal link URL from the NMPushActionCallbacks
class:
Custom Intent Handling
Step 1: Configure Deeplink in Push Action
In the Netmera panel or via REST API, set
deeplink
as the push action.Include any custom parameters in the deeplink configuration.
Step 2: Implement a Custom Callback in the Android SDK
Define a custom handler in the SDK's initialization configuration by assigning it to the
nmDeeplinkCallback
.This setup directs the SDK to bypass its default handling of the deeplink and forward the
pushObject
to your custom callback.
Last updated
Was this helpful?