如何从Chrome中的网页启动InstantApp



我开发了我的第一个Android Instant应用程序,该应用现在可以在Google Play上使用。
我想从Chrome的网页调用该应用,但它不起作用。

以Wish(www.wish.com)为例,我尝试了Android Chrome上的以下链接。

1:<a href="https://www.wish.com/">link1</a>

2: <a href="intent://www.wish.com/#Intent;action=com.google.android.instantapps.START;scheme=https;package=com.google.android.instantapps.supervisor;S.browser_fallback_url=https%3A%2F%2Fwww.wish.com%2F;S.android.intent.extra.REFERRER_NAME=https%3A%2F%2Fwww.google.co.jp;launchFlags=0x8080000;end">link2</a>

但是上面的链接都没有起作用(单击它们只是导航到愿望的网页,但没有即时应用程序显示),尽管第二个似乎是Google在其搜索结果页面中使用的。

我还确认了该应用程序可以通过am命令启动:

am start -a com.google.android.instantapps.START -c android.intent.category.BROWSABLE -d https://www.wish.com/

有人知道如何从网页启动即时应用吗?

Galaxy S8上的Android 7.0
Chrome for Android 60.0.3112.116

我通过从firebase Dynamics链接创建动态链接https://firebase.google.com/docs/dynamic-links在firebase Console中找到了解决此问题的解决方案。在未安装应用程序时,请发送用户即将应用应用程序的选项。我从https://developer.android.com/topic/instant-apps/faqs.html找到了它(在应用程序链接,深链接和URL处理部分)

>

喜欢这个

对不起我的英语。

只有firebase Dynamics链接才能从Web打开Instant应用程序。您可以轻松地手动生成它,但首先检查它在Firebase控制台中的工作原理。创建测试链接后,请使用链接详细信息和链接预览。

示例链接:

https://firebase.page.link/?link=https://instant.example.com&apn=package_name&afl=https://example.com

清单中的即时应用程序配置:

    <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" />
            <data
                android:host="instant.example.com"
                android:pathPrefix="/"
                android:scheme="https" />
        </intent-filter>
        <meta-data
            android:name="default-url"
            android:value="https://instant.example.com" />
    </activity>

最新更新