Branch makes it simple to enable Android App Links while greatly improving on them, offering full attribution, supporting edge cases where Android App Links fail, and allowing you to deep link when the user doesn't have your app installed. Note that Android App Links only work on Android 6+; Branch can handle the rest!
- Start by generating a SHA256 fingerprint of your app's signing certificate.
a. Navigate to your keystore file. This is the file that you use to build the debug and production version of your APK file before deploying it.
b. Run this command to generate the fingerprint:
keytool -list -v -keystore xxxx-example-my-release-key.keystore
c. You'll see a value like
come out the other end. Copy this.
- Now, you’ll enable app links on the Branch dashboard by doing the following:
a. Head to the Configuration page on the Branch dashboard.
b. Toggle the Enable App Links checkbox in the Android section.
c. Paste the copied fingerprint value into the SHA256 Cert Fingerprints field that appears. You can insert both your debug and production fingerprints for testing. Simply separate them with a comma.
d. Scroll down and click Save.
- Now, add your Intent Filter to Manifest by going to the Link Domain section on the Configuration page.
a. Copy your domain name.
b. Choose the
Activityyou want to open up when a link is clicked. This is typically your
BaseActivitythat all other activities inherit from (and likely the same one you selected in the SDK integration guide.
c. Inside your
AndroidManifest.xml, locate where the selected
d. Within the
Activitydefinition, insert the intent filter provided below (making sure that
xxxxmatches the subdomain prefix you've been assigned or selected for yourself). Add this as its own separate intent filter.
e. If you use a custom domain or subdomain for your Branch links, you should also add an entry for:
<data android:scheme="https" android:host="mycustomdomainorsubdomain" />
<intent-filter android:autoVerify="true"> <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="xxxx.app.link" /> <data android:scheme="https" android:host="xxxx-alternate.app.link" /> <data android:scheme="https" android:host="xxxx.test-app.link" /> <data android:scheme="https" android:host="xxxx-alternate.test-app.link" /> </intent-filter>
The system must be able to verify every host specified in a URL intent filters’ data elements against the Digital Asset Links files hosted on the respective web domains. If any verification fails, the app is not verified to be a default handler for any of the URL patterns defined in the app's intent filters. You can use Google's Statement List Asset Generator to test your existing statement file.
keytool -printcert -jarfile my_app.apkon your APK file.
Updated 4 months ago