gpt4 book ai didi

android - 如果深层链接包含特定路径,则丢弃该深层链接

转载 作者:行者123 更新时间:2023-12-05 06:02:38 25 4
gpt4 key购买 nike

我的 list 中有一个深度链接的实现,它运行良好

    <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="blablabla.com"
android:scheme="https" />
<data
android:host="${applicationId}"
android:scheme="bla" />
</intent-filter>

我想知道是否有任何方法可以不接受包含特定路径的深层链接 URL?例如。如果 blablabla.com/specificPath 不接受(不打开应用程序),但接受具有相同主机名的任何其他路径。

最佳答案

安卓Deep Links 不提供明确排除 URL 的方法,最佳做法是使用深层链接专门定义您要访问到您的应用的 URL。

在这种情况下访问如下 URL:

www.blablabla.com/specificPath
www.blablabla.com/specificPath/
www.blablabla.com/specificPath/default.aspx
www.blablabla.com/specificPath/other/

您将使用 android:pathPrefix 将您的 Intent 过滤器的配置定义为:

 <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="blablabla.com"
android:scheme="https"
android:pathPrefix="/specificPath" />
</intent-filter>

关于android - 如果深层链接包含特定路径,则丢弃该深层链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66885020/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com