Android深层链接仅适用于某些网站

Jav*_*ado 8 android deep-linking intentfilter android-app-indexing firebase-app-indexing

我在我的应用程序中使用应用程序索引,但有时它无法正确接收来自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>
Run Code Online (Sandbox Code Playgroud)

这是我的按钮中的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>
Run Code Online (Sandbox Code Playgroud)

如果我打开此地址(制作)中的链接,则会打开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

xfd*_*dai 2

如果您在 Android 浏览器(Android 4.2 之前的默认浏览器)中测试它,它可以工作。所以它似乎是 Android chrome 浏览器的一个功能。\n从这里引用:https: //developer.chrome.com/multidevice/android/intents

\n\n
\n在以下情况下,Chrome 不会\xe2\x80\x99 启动给定 Intent URI 的外部应用。\n\n当 Intent URI 从键入的 URL 重定向时。\n当 Intent URI 在没有用户手势的情况下启动时。 \n
\n\n

就您而言,它与输入的网址相同。

\n\n

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

\n