Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Android深层链接仅适用于某些网站大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我在我的应用程序中使用应用程序索引,但有时它无法正确接收来自Chrome的意图.

如果我从我的生产网站打开链接,它将由chrome打开.所以我创建了一个有相代码的测试站点.但是,在这种情况下,我的应用程序正确打开深层链接.

找不到任何解释,因为它在网络中使用相同的代码(但在不同的网站中)和相同的Android应用程序.

这是我的意图过滤器:

<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:scheR_880_11845@e="https" android:host="soriabus-web.appspot.com" android:pathPrefix="/" />
        </intent-filter>

这是我的按钮中的HTML代码

<a href="https://soriabus-web.appspot.com/parada/1/plaza-mariano-granados/true"
"type="button"
role="button"
class="btn btn-priMary">
Abrir Soria Bus
</a>

如果我打开此地址(制作)中的链接,则会打开play商店(链接的末尾是重定向到Google Play):

https://soriabus-web.appspot.com/parada/1/plaza-mariano-granados

如果我在这个其他地址(测试)中打开链接,它会打开我的app correclty:

https://central-splice-128620.appspot.com/parada/1/plaza-mariano-granados

我不明白为什么链接处理不同.谢谢.

编辑:

是因为我正在关注同一网站内的链接吗?

https://soriabus-web.appspot.com/parada/1/plaza-mariano-granados
=>
https://soriabus-web.appspot.com/parada/1/plaza-mariano-granados/playstore

解决方法

如果您@R_944_5313@d浏览器(Android 4.2中的认浏览器)中进行测试,则可以正常使用.所以它似乎是Android Chrome浏览器的一个功能.
从这里提到: https://developer.chrome.com/multidevice/android/intents
And Chrome doesn’t launch an external app for a given Intent URI in the following cases.

When thE intent URI is redirected from a typed in URl.
When thE intent URI is initiated without user gesture.

在您的情况下,它与键入的URL相同.

如果您想从Chrome打开它,您应该尝试使用Google推荐的上述页面中的intent://语法.

大佬总结

以上是大佬教程为你收集整理的Android深层链接仅适用于某些网站全部内容,希望文章能够帮你解决Android深层链接仅适用于某些网站所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。