给定以下 URL:
1. www.example.com
2. www.example.com/a
通过 deeplinking ,我希望我的应用程序仅对 1
使用react,而不 2
使用react。
<data
android:host="*.example.com"
android:pathPrefix="/"
android:scheme="http"/>
这当然会捕获所有 www.example.com/...
url,我如何才能仅匹配 www.example.com
而没有任何路径和与 www.example.com/a
不匹配?
最佳答案
这对我有用,将路径设置为空并包含一个工具:忽略以避免 lint 错误。
<data
android:host="*.example.com"
android:path=""
android:scheme="http"
tools:ignore="AppLinkUrlError"
/>
关于Android深度链接: match url only when no path,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39266555/