首页 > 解决方案 > Android Instant App URL 执行问题

问题描述

我创建了一个我认为是 android 即时应用程序。每当我通过 Android Studio 测试即时应用功能时,它都会按预期工作。我已按照说明生成用于将免安装应用链接到 URL 的关联文件,并将它们相应地放置在我的网站上。我已将签名包上传到 alpha 封闭测试轨道。我使用的 URL 将用于启动应用程序。但是,当我转到设置-> 谷歌-> 应用程序和通知并删除即时应用程序时,该链接不再有效,它会将我直接带到该网站。我不明白我做错了什么,因为我理解不需要预安装即时应用程序 URL 应该触发我假设 Play 商店发送捆绑包以加载到内存中(某种)。我认为我应该能够在不先安装它的情况下运行即时应用程序是否正确?任何帮助,将不胜感激。下面是我的清单文件。我认为这是正确的。

几乎相同的问题:单击链接时未启动 InstantApp

我已经尝试过该帖子中提到的解决方案。没有成功。

如果这个描述/问题很糟糕,请告诉我,我会努力让它变得更好。第二个帖子第一次被删除我想是因为它很烂?不知道。提前感谢社区的帮助。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:dist="http://schemas.android.com/apk/distribution"
        xmlns:tools="http://schemas.android.com/tools"
        package="learn.instantapps">
    
        <!-- The following declaration enables this module to be served instantly -->
        <dist:module dist:instant="true"></dist:module>
    
        <application
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:targetSandboxVersion="2"
            android:theme="@style/AppTheme">
    
            <activity android:name="learn.instantapps.MainActivity">
    
    
                <meta-data
                    android:name="default-url"
                    android:value="https://mysite/main" />
    
    
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
                <intent-filter android:order="1">
                    <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="my site"
                        android:path="/main" />
                </intent-filter>
                <intent-filter android:order="1">
                    <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="my site"
                        android:path="/main" />
                </intent-filter>
    
    
            </activity>
        </application>
    
    </manifest>

标签: androidandroid-instant-apps

解决方案


推荐阅读