Android App Links

We've built the Yozio Platform and our Android SDK v1.1.13 to work with Android M and Android App Links. Read on to find out how to get started using Android App Links with your Yozio SuperLinks.

Article Contents

Overview

Here's an overview, FAQ style.

Google introduced App Links as part of its M Developer Preview release. This feature introduces a new option for handling web site links, allowing clicked links to go directly to the website's official app, instead of asking the user to chose how to handle the link.

Why is this is important?

This feature saves the user time and helps developers deliver a better experience. Users can also select whether an app should always open specific types of links automatically or prompt the user each time.

How can you test on Android M?

With Developer Preview 3, the official Android 6.0 SDK is now available from the Android SDK Manager - https://developer.android.com/preview/setup-sdk.html

To handle App Links automatically, app developers and website owners must configure their apps to declare connections with websites and request verification. App developers need to create intent filters within the app manifest to declare the URL patterns/host names, for example https://www.example.com, to be handled by your app. In addition, app developers need to configure the app by enabling automatic verification to request verification of App Links. Finally, app developers also need to publish a Digital Asset Links JSON file that Google will use to verify the relationship between the app and the given URL pattern/hostname. For example https://www.example.com/.well-known/assetlinks.json.

Google will access the JSON file during new app installation. Once verified, if the user with an app configured to handle App Links automatically clicks any URL on Android M that starts with www.example.com, App Links will be triggered and the app will be launched.

You can learn more about this at https://developer.android.com/preview/features/app-linking.html

We've built the Yozio Platform and our Android SDK v1.1.13 to work with Android M. To get started using Android App Links with your Yozio SuperLinks please see the setup details here.

Yes. Learn more about that here.

You bet! Learn more about that here.

Setup

Steps

  1. Configure intent filters within your app
  2. Publish a Digital Asset Links JSON file on your website
  3. Publish Updated Android App
  4. Configure App Links Settings in the Yozio Web Console

Before you start setup ensure you are integrated with Yozio Android SDK v1.1.13.

Configure intent filters within your app

First you need to create intent-filters within your app for your website URLs. If you are already integrated with Yozio for deep linking you'll be re-configuring your AndroidManifest.xml.

You will need to configure your app to request verification of App Links. Do this by setting the autoVerify tag to true in any of your intent-filters.

1
2
3
4
5
    <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" (or android:scheme="http") android:host="deeplink.yozio.com" 

The next step is to publish a Digital Assets Links JSON file on your hosts. This will allow Android to verify that your app should be allowed to use the app linking behavior.

Important note: If you have configured any hosts other than deeplink.yozio.com in AndroidManifest.xml with android:scheme="https" and android:name="android.intent.category.BROWSABLE", you will need to host a JSON file on the respective hosts.

Here is a sample JSON file that should be hosted:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
    [
          {
            "relation": ["delegate_permission/common.handle_all_urls"],
            "target": {
                 "namespace": "android_app",
                "package_name": "com.example.myapp",
                 "sha256_cert_fingerprints": ["6C:EC:C5:0E:34:AE....EB:0C:9B"]
              }
          }
    ]
  • package_name: android app package name as per AndroidManifest.xml file.
  • sha256_cert_fingerprints: can be generated by executing the below Java keytool in the terminal echo | keytool -list -v -keystore /path/to/app/release-key.keystore 2> /dev/null | grep SHA256:

Note that you can also declare associations with multiple apps within the same assetlinks.json file.

Important Note:

As long as there is ONE intent-filter with data tag has autoVerify enabled, Android M will try to verify all the hosts included in the manifest file and will only pass if ALL verification succeeded.

Publish Updated Android App

Now it's time to publish your updated app to Google Play before proceeding to the next step.

If you wish to test before release, you can publish your updated app to the Google Play staging environment (more info found here).

Start by going to Yozio Console > Settings > App Links Settings. There, update your package_name and sha256_cert_fingerprints. Then click Update App Links Settings.

Android M App Link Settings

Notes:

  • If you can see the page but the fields are disabled, you need to first tell Yozio that you have an Android App by going to Settings > Default Redirect Settings scroll to Android and selecting Yes to Do you have an Android app?

Android M Have Android App set to yes

In cases where Yozio is not able to deep link a user due to misconfiguration, Yozio will fallback to the redirect settings you have specified for users who do not yet have your app, such as taking them to Google Play or a web URL.

Thus, the best migration path is to configure intent filters within your app > publish a Digital Asset Links JSON file on your website > publish updated Android app > configure App Links Settings in the Yozio Web Console >

For testing before release to production, publish your updated app to Google Play Staging rather than pushing it to production.

Need Help?

The Yozio team is here to help! Feel free to reach out to us at [email protected] or use the chat feature in the Yozio Console.