gpt4 book ai didi

Android - 在更新 SDK 版本 23 后添加至少一个带有 ACTION-VIEW Intent 过滤器的 Activity

转载 作者:IT老高 更新时间:2023-10-28 12:52:02 26 4
gpt4 key购买 nike

我在 AndroidManifest.xml 中得到以下工具提示:

App is not indexable by Google Search; consider adding at least oneActivity with an ACTION-VIEW intent-filler. See issue explanation formore details.

Adds deep links to get your app into the Google index,to get installs and traffic to your app from Google Search.

enter image description here

谁能解释为什么会这样?

最佳答案

来自官方文档:

To enable Google to crawl your app content and allow users to enter your app from search results, you must add intent filters for the relevant activities in your app manifest. These intent filters allow deep linking to the content in any of your activities. For example, the user might click on a deep link to view a page within a shopping app that describes a product offering that the user is searching for.

使用此链接 Enabling Deep Links for App Content你会看到如何使用它。

使用这个Test Your App Indexing Implementation如何测试它。

The following XML snippet shows how you might specify an intent filter in your manifest for deep linking.

<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>

To test via Android Debug Bridge

$ 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 - 在更新 SDK 版本 23 后添加至少一个带有 ACTION-VIEW Intent 过滤器的 Activity,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34367875/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com