android 应用程序 link 如何检测 URL 的路径?

How can the android app link detect the URL's path?

现在我正在尝试开发 android 应用程序链接。我已经指定了路径,以便在 URL 完全匹配时我可以打开应用程序。但是我发现如果host匹配上了,不管路径是什么,app都会被要求打开。因此,我想修复它。非常感谢。

这是我的代码:

<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="http" android:host="www.mydomain.com" android:pathPrefix="[mypath1]" />
<data android:scheme="https" android:host="www.mydomain.com" android:pathPrefix="[mypath]" />
</intent-filter>

使用 Path 而不是 pathPrefix

<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="http" android:host="www.mydomain.com" android:path ="/" />
<data android:scheme="https" android:host="www.mydomain.com" android:path ="/" />
</intent-filter>