androiddeep-linkingandroid-deep-linkautolink

Auto verify not always working in App Links using android


I am currently working on implementing app links functionality in my application. The goal is to scan QR codes and redirect users inside the app. However, I am encountering an issue where, sometimes, after installing a beta version of the app, scanning a QR code successfully takes me directly inside the app. But, if I uninstall the app and reinstall it again, the functionality stops working.

In the settings of my app, "Open Supported Links" is turned on, but there is no "Verified Link" displayed. Interestingly, the same code works intermittently.

Here are some additional details:

The assetlinks file is already available at the following location: https://example.com/.well-known/assetlinks.json. I have also used the Google link checker, which shows that all my SHA codes are active at this location.

The relevant section of my manifest file is as follows:

<activity
    android:name=".ui.other_common_screens.splash.view.SplashActivity"
    android:exported="true"
    android:launchMode="singleTop"
    android:screenOrientation="portrait"
    android:windowSoftInputMode="adjustPan">

    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-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="https" />
        <data android:host="example.com" />
        <data android:pathPrefix="/" />
    </intent-filter>
</activity>

The deep link URL I am using is: https://example.com/services/categories/7/service/11/da-001/donation-details/2/25

The behavior I'm experiencing is quite confusing. Even after clearing my cache and uninstalling the app from the beta version, the app links functionality sometimes works and sometimes doesn't, depending on a fresh install.

Kindly guide me to fix this issue, as I want Auto-verify for my users to use Deeplink.


Solution

  • After thorough investigation, I identified and fixed the issue. It wasn't related to my Auto Verify feature or code, but rather to our server's Load Balancer. The assetLinks.json file was only available on one server instance, causing intermittent 404 errors when accessed by Google. I wanted to share this finding to potentially help others facing similar challenges.