Implement Deep Linking for Android
Learning Objectives
After completing this unit, you’ll be able to:
- Understand how Android and Marketing Cloud Engagement route deep links from emails.
- Implement deep links to Android apps.
Complete the Links in Your Mobile App
Pia is working with the NTO developers to implement mobile app changes for Android 12, so it makes sense that she wants to follow the latest procedures for the mobile platform. Starting with Android 12, any links to a mobile app that are not referenced in an assetlink.json file are automatically routed to the mobile device’s default browser.
This means that users no longer receive a window asking them whether they want to open the link in a browser window or in the app. This change provides a little extra security to deep linking interactions by preventing automatic access to a mobile device’s app, and it also improves the user experience by removing yet another click. This file is similar to the apple-app-site-association used for iOS Universal Links, just tailored to Android’s specifications. Take a look at the sample file to see what your file should look like.
[{ "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "web", "site": "https://www.example.com" } },{ "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "org.example.ourapp", "sha256_cert_fingerprints": ["10:39:38:EE:45:37:E5:9E:8E:E7:92:F6:54:50:4F:B8:34:6F:C6:B3:46:D0:BB:C4:41:5F:C3:39:FC:FC:8E:C1"] } }]
All this code directs the message as shown in this figure.
Complete the Settings in Marketing Cloud Engagement Setup
Pia has the developers insert the links that go directly to the app in the assetlinks.json file. She also makes sure that they add NTO’s Marketing Cloud Engagement click domain as an intent filter in their Android manifest. After confirming everything is in place, she’s ready to upload the file to Marketing Cloud Engagement.
- Pia navigates to Setup in Marketing Cloud Engagement.
- She clicks Feature Settings in the Platform Tools section of the Setup menu.
- She clicks Email Studio, then selects Deep Linking Applications.
- She clicks Browse, then selects the file to upload and clicks Save.
- She waits about 10 minutes for the upload process to complete, then goes to the URL specified in the app and makes sure everything looks correct.
Again, this process requires extensive testing to make sure all the links work correctly and nothing is broken. If they need to fix anything, or when Pia needs to make changes in the future, she can just upload a new version of the file using this same process.
Obviously, keeping up with changing mobile apps and marketing campaign needs means that Pia will need to modify both iOS and Android resources in the future. However, Marketing Cloud Engagement makes testing and implementing these changes more manageable.