0

我正在尝试通过应用操作将我的 android 应用扩展到 google Assistant。

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

但是,当我向谷歌助手说或输入一些请求时,它不起作用。

试过start running in Fit Actionsand adjust desk to 42 centimeters,但没有用

动作.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>
4

0 回答 0