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:scheme="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

解决方法

如果您在Android浏览器(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性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...