2

我想深層鏈接的網址是按以下格式: https://abc.example.com應用索引:谷歌應用程序搜索不與指定的URI工作

我在特定活動意圖過濾器看起來是這樣的:

<intent-filter> 
<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"/> 
<data android:host="abc.example.com"/> 
<data android:pathPattern="/"/> 
</intent-filter> 

在做一個谷歌瀏覽器搜索,我的活動深入鏈接罰款。但是,Google應用啓動器(本地搜索)中的搜索不起作用。這是我編寫的活動中在onStart和的onStop:

public void onStart() { 
    super.onStart(); 
    client.connect(); 
    Action viewAction = Action.newAction(
      Action.TYPE_VIEW, 
      "Title", 
      Uri.parse("android-app://my-app-package-name/https/abc.example.com") 
    ); 
    AppIndex.AppIndexApi.start(client, viewAction); 
} 

有什麼東西在意圖過濾器或者需要添加/修改,以獲得谷歌應用程序搜索工作URI失蹤?

回答

0

創建ViewAction時的'標題'參數應該簡潔並且與鏈接的內容相關的關鍵字也很好。

而URL應該是網頁的URL而不是深層鏈接。 您在here中有更多關於API調用的信息。

此外,只有在您打開應用程序內容一段時間後,本地搜索才能完全運行以及自動完成。

相關問題