繁体   English   中英

使用Google Assistant通过语音测试应用操作的正确语法是什么?

[英]What is the proper syntax for testing app actions via voice using google assistant?

我目前正在用Kotlin编写一个Android应用程序,以测试Google提供的新的内置应用程序操作。 目前,请查看action.intent.GET_ACCOUNT。

我已经有Android Studio,我的Google助手和我的设备都连接到相同的开发者帐户。 我还用相同的包裹名称将草稿上传到了Play商店。 我可以使应用程序动作与测试工具一起运行,但是无法使用Google Assistant通过语音调用它。

我也咨询了此链接以寻求帮助,但运气不好的Android App Actions无法与语音命令配合使用

我对Google Assistant所说的是“嘿Google用Big Money查看我的帐户”。 但是,我得到的只是一个在线搜索结果。 有什么明显的我想念的东西吗? 谢谢!

我的清单:

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
    <meta-data android:name="com.google.android.actions" android:resource="@xml/actions" />

    <activity
            android:name=".views.MainActivity"
            android:exported="true"
            android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>

            <category android:name="android.intent.category.LAUNCHER"/>
        </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"/>
            <data
                    android:scheme="http"
                    android:host="martymoneybank.com"
                    android:pathPattern="/account"/>
        </intent-filter>

    </activity>
</application>

我的Action.xml:

<actions>
<action intentName="actions.intent.GET_ACCOUNT" >

    <fulfillment urlTemplate="http://martymoneybank.com/account{?accountType}">
        <parameter-mapping
                intentParameter="account.name"
                urlParameter="accountType" />
    </fulfillment>
</action>

测试工具:

测试工具视图

这是针对这种情况的常规故障排除步骤。 如果它通过Studio测试工具工作,但不能通过语音工作,则存在两个潜在问题:

  1. 您使用了错误的(或不受支持的)短语,即Assistant无法与App Action匹配。 要查找示例查询,请转到此处 ,找到助手意图,然后查看示例查询。 例如。 在此处输入图片说明

    但是,根据您的情况, GET_ACCOUNT没有任何示例查询,因此请在此处提交错误。

  2. 这是助手方面的错误。 如果您尝试使用示例查询,但仍然无法正常运行(但通过Studio测试工具可以正常运行),请提出问题


就是说,对于GET_ACCOUNT ,您可以尝试看看这些阶段是否有效(还要注意,如果Assistant在记录您所说的内容时遇到任何问题,当然没有“嘿Google”,您也可以使用键盘输入短语) :

嘿Google,使用Big Money获取储蓄帐户余额

要么

嘿Google,在Big Money上查看我的储蓄帐户余额

要么

嘿,谷歌,问大钱告诉我我的储蓄帐户余额

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM