Search code examples
androiddeep-linking

Matching on URL's fragment in Android deep linking configuration


I'm currently adding deep link support for my app.

Our web app is routed using the fragment part of urls (e.g. example.com/#/nested/page), and we'd like the app to only open certain routes.

Something like this:

<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:pathAdvancedPattern="#/whitelisted/.+" />
</intent-filter>

My hope would that urls like https://example.com/#whitelisted/route would "pass" while https://example.com/#not/allowed/route would not.

Is there a way to achieve this that I've missed, or is it just not something that deep linking on Android supports?


Solution

  • What you are seeking (Intent filtering on URL fragments) is part of Android 15, at least in Developer Preview 2. At best, that will ship later in 2024, and it will be years before your desired feature is available on most Android devices.