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调用的信息。

此外,只有在您打开应用程序内容一段时间后,本地搜索才能完全运行以及自动完成。

相关问题