带有 Google 助手和自定义 inetent 名称的 Android 应用

问题描述

我正在尝试通过应用操作将我的 Android 应用扩展到 Google 助理。

当我使用应用操作测试工具时,它适用于 actions.intent.[ACTION_NAME] 和我的自定义意图名称

但是,当我向 Google 助理说出或输入一些请求时,它不起作用。

尝试过 start running in Fit Actionsadjust desk to 42 centimeters,但没有用

actions.xml

<actions>
<action intentName="actions.intent.START_EXERCISE">
        <fulfillment urlTemplate="https://fit-actions.firebaseapp.com/start{?exerciseType}">
            <parameter-mapping
                intentParameter="exercise.name"
                urlParameter="exerciseType" />
        </fulfillment>

        <parameter name="exercise.name">
            <entity-set-reference entitySetId="ExerciseEntitySet" />
        </parameter>
    </action>

    <!-- Define an inline inventory -->
    <!-- This sample maps supported entities with the class Fitactivity.Type -->
    <entity-set entitySetId="ExerciseEntitySet">
        <entity
            name="@string/activity_running"
            identifier="RUNNING" />
        <entity
            name="@string/activity_walking"
            identifier="WALKING" />
        <entity
            name="@string/activity_hiking"
            identifier="WALKING" />
        <entity
            name="@string/activity_cycling"
            identifier="CYCLING" />
    </entity-set>

<action intentName="flh.action.intent.MOVE_POSITION" queryPatterns="@array/HeightQueries">
        <parameter name="height" type="https://schema.org/Number" />

        <fulfillment
            urlTemplate="https://fit-actions.firebaseapp.com/{?move_to_height}">
            <parameter-mapping
                intentParameter="height"
                urlParameter="move_to_height" />
        </fulfillment>
    </action>
</actions>
<string-array name="HeightQueries">
        <item>adjust desk to $height centimeters</item>
        <item>adjust desk to $height inches</item>
    </string-array>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...