admin管理员组

文章数量:1123360

I am kind of confused due to the intent-filter specification required to open app links on android 12+ without needing the option selections which app should open the link.

Initially we started with the current recommended approach with autoVerify="true".

<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="somefixedprefix.mainurl.de"
   />
</intent-filter>

Which worked on Android 12+ devices but not on Android < 11 due to links not being auto verified.

For those we implemented another intent filter

<intent-filter>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <data android:scheme="somecustomscheme"
        android:host="somefixedprefix.mainurl.de"
  />
</intent-filter>

Which then worked on android < 12.

Both also handle somecustomscheme://somefixedprefix.mainurl.de/someappendix or

Now my question is as I completely confused: On Android 12+ can I still use somecustomscheme://somefixedprefix.mainurl.de/someappendix to open the app from an app link without the selection dialog coming up with which app I want to open a link (of course only if there is no other app that has the same scheme defined in intent-filter).

I am kind of confused due to the intent-filter specification required to open app links on android 12+ without needing the option selections which app should open the link.

Initially we started with the current recommended approach with autoVerify="true".

<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="somefixedprefix.mainurl.de"
   />
</intent-filter>

Which worked on Android 12+ devices but not on Android < 11 due to links not being auto verified.

For those we implemented another intent filter

<intent-filter>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <data android:scheme="somecustomscheme"
        android:host="somefixedprefix.mainurl.de"
  />
</intent-filter>

Which then worked on android < 12.

Both also handle somecustomscheme://somefixedprefix.mainurl.de/someappendix or https://somefixedprefix.mainurl.de/someappendix

Now my question is as I completely confused: On Android 12+ can I still use somecustomscheme://somefixedprefix.mainurl.de/someappendix to open the app from an app link without the selection dialog coming up with which app I want to open a link (of course only if there is no other app that has the same scheme defined in intent-filter).

Share Improve this question asked 14 hours ago ProgressiveProgressive 1072 silver badges10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

To address your confusion, let's clarify the behavior of app links and custom schemes in Android, particularly for Android 12+:

  • App Links (https scheme with android:autoVerify="true") On Android 12+, app links with android:autoVerify="true" are verified against a Digital Asset Links file. If the domain is verified, links in this form (https://...) will open directly in your app without showing the app selection dialog.
  • On Android < 12, app links are still supported, but the automatic verification (autoVerify="true") is not enforced. Instead, the user may need to explicitly set your app as the default for those links in system settings.

Custom Schemes (somecustomscheme://)

  • Custom schemes (somecustomscheme://...) are not verified via Digital Asset Links. They rely on intent filters and work similarly across all Android versions.
  • If no other app declares the same scheme in their intent filters, your app will open directly when the custom scheme is used.
  • If multiple apps declare the same scheme, the app selection dialog will appear, regardless of the Android version.

Yes, you can still use somecustomscheme://... to open your app directly, provided no other app has declared the same scheme in their intent filters. This behavior is consistent across all Android versions, including Android 12+.

本文标签: intentfilterValid intent filters for app links on Android 12Stack Overflow