关联网站未重定向到Android Instant App

问题描述

我正在尝试通过导航到已在Android Studio中测试并部署到应用商店的关联链接来从URL打开即时应用。我已经测试了以下内容

意图过滤器也按照说明进行了完全配置:

        <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="http"
                android:host="example.app" />
        </intent-filter>
        <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="http"
                android:host="example.app" />
        </intent-filter>
        <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="example.app" />
        </intent-filter>
        <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="example.app" />
        </intent-filter>

但是,当我导航到URL时,它没有按预期重定向到我的即时应用程序。有人可以引导我指出可能出问题的地方吗?

解决方法

我想出了答案。如果我直接在浏览器上输入URL,它将不会打开即时应用程序,而是打开相应的网站。但是,如果我单击另一个网站的链接中的URL或文本消息,它将按预期方式打开即时应用程序。奇怪的是,我试图从NFC标签启动,该标签被视为浏览器中输入的URL。

,

@Jacobo我在另一篇文章中看到有人提到Firebase Dynamic Link,即使是针对浏览器,它们也已修复。我尚未进行测试,因为我实际上是在尝试修复一个步骤。如果我没有缓存或安装即时应用程序,那么我的链接将转到网站,而不是InstantApp。一旦我手动打开Instant或安装完整版本,就可以正常工作,但是未缓存/未安装的版本无法正常工作。在Google Play上,我已经看到“立即尝试”按钮。