我目前正在使用 Kotlin 编写 Android 应用,以测试 Google 提供的新内置应用操作。目前,正在查看 actions.intent.GET_ACCOUNT。
我已经有 Android Studio、我的谷歌助手和我的设备都连接到同一个开发者帐户。我还使用相同的包名将草稿上传到 Play 商店。我能够使用测试工具运行应用程序操作,但无法使用 Google 智能助理通过语音调用它。
我也引用过此链接寻求帮助,但没有成功 Android App Actions does not work with voice command
我对 Google 智能助理说的是“嘿 Google 查看我的 Big Money 帐户”。但是,我得到的只是一个在线搜索结果。有什么明显的我想念的吗?谢谢!
我的 list :
<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 测试工具工作,但不能通过语音工作,则存在两个潜在问题:
您使用的是错误的(或不受支持的)短语,Google 助理无法将其与 App Action 匹配。要查找示例查询,请转到 here ,找到 Assistant Intent 并查看示例查询。例如。
但是,在您的情况下,
GET_ACCOUNT
没有任何示例查询,因此请为此提交错误 here .这是 Google 助理方面的一个错误。如果您尝试示例查询但它仍然不起作用(但通过 Studio 测试工具它可以正常工作),那么请 file an issue .
也就是说,对于 GET_ACCOUNT
,您能否尝试看看这些阶段是否有效(还值得注意的是,如果 Google 助理在转录您所说的内容时遇到任何问题,您可以使用键盘输入短语,当然没有“嘿谷歌”):
hey google, get savings account balance using Big Money
或
hey google, check my savings account balance on Big Money
或
hey google, ask Big Money to tell me my savings account balance
关于android - 使用谷歌助手通过语音测试应用程序操作的正确语法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56245648/