动态链接的 Intent 过滤器未按预期工作

Intent filter for dynamic links is not working as expected

我设置了以下意图过滤器来检测要在我们的应用程序中打开的链接。

            <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:host="share.example.tv"
                    android:pathPrefix="/"
                    android:scheme="https" />
                <data
                    android:host="example.tv"
                    android:pathPrefix="/u"
                    android:scheme="https" />
            </intent-filter>

我希望我的应用在 2 个链接下方打开

  1. https://share.example.tv/tv34gh
  2. https://example.tv/u/some-user-name

但我的应用程序也显示这些链接

https://example.tv/anything/literally-anything

如果我将不同意图过滤器中的两个链接分开,以获得相同的activity,如下所示

            <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:host="share.example.tv"
                    android:pathPrefix="/"
                    android:scheme="https" />
            </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:host="example.tv"
                    android:pathPrefix="/u"
                    android:scheme="https" />
            </intent-filter>

这行得通,但我不知道为什么。