Can two Android apps use the same domain with different path prefixes?


I am trying to configure Android deep linking for two different Android applications that use the same domain, but each application should handle a different URL path.

For example, suppose I have two apps:

  • App 1 should handle: https://example.com/app1/...

  • App 2 should handle: https://example.com/app2/...

The domain example.com is common to both applications. The only difference is the URL path.

I have configured separate intent-filters in both applications, for example:

<!-- App 1 -->
<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="example.com"
        android:pathPrefix="/app1" />
</intent-filter>
<!-- App 2 -->
<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="example.com"
        android:pathPrefix="/app2" />
</intent-filter>

I have also added both applications, along with their respective SHA-256 certificate fingerprints, to the same assetlinks.json file for example.com.

The expected behavior is:

https://example.com/app1/test
        → App 1

https://example.com/app2/test
        → App 2

However, when I check Android Settings → Apps → Open by default → Supported web addresses, the same domain appears to be associated with only one application. This makes me unsure whether Android supports two applications using the same verified domain with different path prefixes.

Does Android App Links support two different applications using the same domain with different pathPrefix values, so that each application can handle its own URL paths? If yes, how should assetlinks.json and the intent-filters be configured, and how does Android handle domain verification and the "Open by default" settings in this scenario?

1
Oct 6 at 3:02 PM
User Avatarnidhi sahu
#android#deep-linking#android-deep-link

No answer found for this question yet.