Messages sent with Iterable can include Android App Links, which redirect users to your installed mobile app—no browser required. Iterable tracks clicks on these links as expected.
WARNING
You must set up iOS deep linking before implementing Android deep linking (they rely on similar architecture).
Table of contents
Setting up Android App Links
1. Enable Android App Links
To enable Android App Links, follow these steps:
Configure your Iterable project to support deep links. For more information, read Deep Links Setup.
Configure your mobile app to handle Android App Links by following the instructions in the Android documentation.
-
Create intent filters for Iterable URIs by using the App Links Assistant
Set the Host to your tracking domain. For example,
https://links.<YOUR_TRACKING_DOMAIN>.com
.Set the Path to use
/a
as the pathPrefix.
Generate the assetlinks.json file
2. Upload assetlinks.json
After you generate an assetlinks.json file with your app's fingerprint, you'll need to provide it to Iterable so that it can be hosted at <YOUR_TRACKING_DOMAIN>/.well-known/assetlinks.json. To upload it, follow the instructions in Deep Links Setup.
Then, use Google's Statement List Generator and Tester to test it out.
3. Determine which links to rewrite
To determine which links to rewrite as deep links for a given campaign, Iterable looks at the relevant tracking domain's apple-app-site-association file. Even if you only have an Android app, you'll still need to create this file. To learn how to do so, read Deep Links Setup.
4. Update your code
If you already have a urlHandler
, you can use the same handler for email deep
links by calling handleAppLink
in the activity that handles all Android App
Links in your app:
// MainActivity.java @Override public void onCreate() { super.onCreate(); ... handleIntent(getIntent()); } @Override public void onNewIntent(Intent intent) { super.onNewIntent(intent); if (intent != null) { handleIntent(intent); } } private void handleIntent(Intent intent) { if (Intent.ACTION_VIEW.equals(intent.getAction()) && intent.getData() != null) { IterableApi.getInstance().handleAppLink(intent.getDataString()); // Overwrite the intent to make sure we don't open the deep link // again when the user opens our app later from the task manager setIntent(new Intent(Intent.ACTION_MAIN)); } }
Alternatively, call getAndTrackDeeplink
along with a callback to handle the
original deep link URL. You can use this method for any incoming URLs, as it
will execute the callback without changing the URL for non-Iterable URLs.
IterableApi.getAndTrackDeeplink(uri, new IterableHelper.IterableActionHandler() { @Override public void execute(String result) { Log.d("HandleDeeplink", "Redirected to: "+ result); // Handle the original deep link URL here } });
FAQ
For answers to common questions about deep links, read the Deep Link FAQs.
Comments
0 comments
Article is closed for comments.