App is not indexable by Google Search

最近真是遇到各種沒遇見過的Warning啊,新建了項目,上來就是刺眼的警告,對於有代碼潔癖的真是不友好啊,如下:

Warning: App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent filter. See issue explanation for more details.

官方說如是:

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.

大致意思是說:要使Google能夠獲取您的應用內容並允許用戶從搜索結果中進入你的應用,必須爲manifest中的相關Activity添加一個intent filters。允許深入連接到你的任何Activity中。例如,用戶可以點擊深層鏈接來查看購物應用中的頁面,該頁面描述用戶正在搜索的產品。
更多關於 deep link:Create Deep Links to App Content

如何解決

1、添加intent-filter
在AndroidManifest.xml文件中,至少一個activity的intent-filter中添加

<action android:name="android.intent.action.VIEW" />

2、忽略警告
在app的build.gradle中添加下列代碼:

lintOptions {  
        disable 'GoogleAppIndexingWarning'  
} 

Deeplink有什麼用?
舉例來說,當用戶在其他應用或網頁中點擊了鏈接時,包含了Deeplink的商家APP就可以直接跳轉到相應商品的頁面;沒有Deeplink的APP就只能跳轉到首頁,包括新聞APP的推送等等。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章