我将在AndroidManifest.xml分钟内获得以下工具提示:

应用程序不能通过谷歌搜索进行索引;考虑添加至少一个

添加深度链接以将您的应用程序放入Google索引, 从谷歌搜索获取应用的安装量和流量.

enter image description here

有人能解释一下为什么会这样吗?

推荐答案

根据官方文件:

为了让谷歌能够抓取你的应用程序内容,并允许用户从搜索结果中输入你的应用程序,你必须在应用程序 list 中为相关活动添加意图过滤器.这些意图过滤器允许深入链接到任何活动中的内容.例如,用户可能单击深层链接以查看购物应用程序中描述用户正在搜索的产品的页面.

使用此链接,您将看到如何使用它.

以及如何用这Test Your App Indexing Implementation来测试它.

下面的xml片段显示了如何指定意图过滤 在你的舱单上做深度链接.

<activity
    android:name="com.example.android.GizmosActivity"
    android:label="@string/title_gizmos" >
    <intent-filter android:label="@string/filter_title_viewgizmos">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
        <data android:scheme="http"
              android:host="www.example.com"
              android:pathPrefix="/gizmos" />
        <!-- note that the leading "/" is required for pathPrefix-->
        <!-- Accepts URIs that begin with "example://gizmos” -->
        <data android:scheme="example"
              android:host="gizmos" />

    </intent-filter>
</activity>

通过Android调试桥进行测试

$ adb shell am start
        -W -a android.intent.action.VIEW
        -d <URI> <PACKAGE>

$ adb shell am start
        -W -a android.intent.action.VIEW
        -d "example://gizmos" com.example.android

Android相关问答推荐

Jetpack编写日期 Select 器

RippleTheme在作曲material 1.7.0中被废弃

AdMob:MobileAds. initialize()—java. lang. xml对于某些设备不能强制转换为java. lang. String""

无法在Android中创建通知频道

在带有REACT-Native-CLI的开发和生产中使用Firebase的最佳实践

从 Jetpack Compose 中的图像中删除默认高度

如何删除 Jetpack Compose 中按钮的左边框?

在 AGP 8.0 中构建失败,无法应用插件realm-android. APIandroid.registerTransform已删除

在 kotlin 中动态添加 GridView

NFC getNdefMessage 在 Android 13 上写入标签后返回 null

AirDroid Business 如何能够从屏幕截图中排除覆盖?

Visual Studio 无法在 Android 上编译 .NET MAUI 项目

在 Jetpack Compose 的无状态 Compose 中管理条件逻辑

如果 auth 失败,如何显示 toast jetpack compose firebase if else @Composable 调用只能在 @Composable 函数的上下文中发生

如何在 Jetpack Compose 中的 VisualTransformation 之后将光标保持在文本字段的末尾

Int 传递给 Intent 但Android工作室说我传递了一个字符串

无法解析依赖项'com.github.smarteist:autoimageslider:1.4.0-appcompat'

为什么官方文档用大写字母表示val变量?

如何使用 Kotlin 在 Android Wear(Galaxy watch 4)中继续在后台运行应用程序

Jetpack Compose 中的按钮上的文本未更新