微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

深度链接与 ADB 一起使用,但在点击电子邮件或消息应用程序中的链接时无效

如何解决深度链接与 ADB 一起使用,但在点击电子邮件或消息应用程序中的链接时无效

我的 AndroidManifest.xml 包含:

<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="books.com" android:pathPrefix="/book" />
</intent-filter>

它在运行时用正确的页面打开我的应用

adb shell am start -a android.intent.action.VIEW -d "https://books.com/book/my-book-123" -c android.intent.category.broWSABLE 

adb shell am start -a android.intent.action.VIEW -d "https://books.com/book/my-book-123" com.books.app

当我通过电子邮件或消息应用发送 https://books.com/book/my-book-123 时,它只会在我点击它时打开浏览器。

如果我删除 android:pathPrefix="/book" 它可以工作,但是每个网址都会打开应用程序,而我只想打开 books.com/books 网址

我已经在我的手机中检查过,books.com 没有为我的浏览器设置“始终打开”。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。