Technical Discovery

App Links

Concept:

Context - https://developer.android.com/training/app-links

Android App Links, available on Android 6.0 (API level 23) and higher, are web links that use the HTTP and HTTPS schemes and contain the autoVerify attribute. This attribute allows your app to designate itself as the default handler of a given type of link. So when the user clicks on an Android App Link, your app opens immediately if it's installed—the disambiguation dialog doesn't appear.

If the user doesn't want your app to be the default handler, they can override this behavior from the app's settings.

The following code snippet shows an example of an Android App Link filter:

<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="http" />     <data android:scheme="https" />     <data android:host="myownpersonaldomain.com" /> </intent-filter>

 

Android App Links offer the following benefits:

 

  • Secure and specific: Android App Links use HTTP URLs that link to a website domain you own, so no other app can use your links. One of the requirements for Android App Links is that you verify ownership of your domain through one of our website association methods.

  • Seamless user experience: Since Android App Links use a single HTTP URL for the same content on your website and in your app, users who don’t have the app installed simply go to your website instead of the app — no 404s, no errors.

  • Android Instant Apps support: With Android Instant Apps, your users can run your Android app without installing it. To add Instant App support to your Android app, set up Android App Links and visit g.co/InstantApps.

  • Engage users from Google Search: Users directly open specific content in your app by clicking a URL from Google in a mobile browser, in the Google Search app, in screen search on Android, or through Google Assistant.

Add Android App Links

The general steps for creating Android App Links are as follows:

  1. Create deep links to specific content in your app: In your app manifest, create intent filters for your website URIs and configure your app to use data from the intents to send users to the right content in your app. Learn more in Create Deep Links to App Content.

  2. Add verification for your deep links: Configure your app to request verification of app links. Then, publish a Digital Asset Links JSON file on your websites to verify ownership through Google Search Console. Learn more in Verify App Links.

As an alternative to the documentation linked above, the Android App Links Assistant is a tool in Android Studio that guides you through each of the steps required to create Android App Links.

For additional information, see the following resources:

 

Discovery in intl-whitelabel-app:

  • Existing code shows that the concept of App Links is known in intl-whitelabel-app.

    • References of filters and native handling exists. Specifically, mentioning branch.io. But most of the configurations were done during the market setup in a copy/paste manner. That’s why, we need to revise them as follows:

Note that the following steps can be easily managed using Android Studio assistant for App Links.

  1. Create intent filters in your Android manifest (PLK ES).

  2. Add code to your app's activities to handle incoming links.

    1. @Overrride void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     ...     // ATTENTION: This was auto-generated to handle app links.     Intent appLinkIntent = getIntent();     String appLinkAction = appLinkIntent.getAction();     Uri appLinkData = appLinkIntent.getData();     ... }

      → Here we need to figure out how to route it internally

      1. Example: For push notifications, we used PendingIntent in LocalFirebaseMessagingService

  3. Associate your app and your website with Digital Asset Links. Example:

[{ "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "es.popeyes.android", "sha256_cert_fingerprints": ["E7:53:E0:B3:DA:02:B4:47:31:E1:80:2D:85:14:EF:58:9B:AA:04:B4:21:94:B5:9F:4D:28:41:79:38:5C:0E:8A"] } }]

Checking how to upload assetlinks.json to https://www.popeyes.es/.well-known/assetlinks.json

POC : feat/IBFEC-426-applinks

  • In this PoC, we used a fake domain using external tools to deploy a simple site just to validate the assetlinks.json

  1. Test and validate

    1. Type the site and check that the app is called

  2. Internal routing.

    1. Once the user enters an internal path. For instance, https://www.popeyes.es/menu, the app should be redirected to the /menu internal route. This logic must be generic for any path and be implemented in a new class defined in step 2.

 

Universal Links

https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app

https://gist.github.com/alexathylane/774185e4e15ddcc14f0a1e3c66c943e3