应用已发布到Google Play上,但无法使用Google语音操作

问题描述:

我无法在已经发布到Google Play(私人频道)并下载到手机上的应用程序中成功使用Google System语音操作在应用程序中搜索"(com.google.android.gms.actions.SEARCH_ACTION).

I am unable to successfully use the Google System Voice Actions "Search in App" (com.google.android.gms.actions.SEARCH_ACTION) on an app that I have already published onto Google Play (Private Channel) and downloaded onto my phone.

在匹配意图过滤器之后,带有来自搜索操作的额外查询的意图将传递给MainActivity.

The intent with the query extra from the search action is to be passed on to MainActivity after matching the intent filter.

在发布应用程序之前,我已经使用下面的adb命令完美测试了该应用程序:

Before publishing the app, I have already tested the app using the adb command below which works perfectly:

adb shell am start -a "com.google.android.gms.actions.SEARCH_ACTION" --es query "[query]" -n "com.testapp/.MainActivity"

下面是我的Android清单,其中包含意图过滤器:

Below is my Android manifest which contains the intent filters:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.testapp" >

    <uses-sdk
        android:minSdkVersion="11"
        android:targetSdkVersion="23" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:name=".app.AppController"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        android:allowTaskReparenting="true">

        <meta-data
            android:name="com.google.android.gms.version" 
            android:value="@integer/google_play_services_version" />

        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:exported="true"
            android:launchMode="singleTop" >

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <intent-filter>
                <action android:name="com.google.android.gms.actions.SEARCH_ACTION" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>

            <intent-filter>
                <action android:name="android.intent.action.SEARCH" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>

            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable" />

            <meta-data
                android:name="android.app.default_searchable"
                android:value=".MainActivity" />

        </activity>

    </application>

</manifest>

我是否正确设置了Google语音操作所需的意图过滤器?如果是,为什么不能使用Google App在我的应用程序中搜索关键字?还是有其他考虑因素(例如(仅出于个人猜测)):Google应用缓存/处理"应用内容/意图过滤器等所需的时间,应用名称和搜索关键字不够唯一",或事实而不是将应用分发到专用渠道上?

Are my intent filters required for Google Voice Actions set up correctly, and if so, why did using Google App to search for keywords within my app not work? Or are there any other considerations such as (some personal guesses only): time needed for Google App to "cache/process" app contents/intent filters etc., the app name and search keywords not being "unique" enough, or the fact that the app being distributed onto a Private Channel instead?

希望所有成功实施Google语音操作的人可以共享并提供一些意见.

Hoping for anyone who has successfully implemented Google Voice Actions before to share and provide some input.