首页 > 解决方案 > 如何更改“功能”以从 OPEN_FEATURE 的应用操作中打开?

问题描述

这是我拥有的 actions.xml:

<actions>
<action intentName="actions.intent.GET_ACCOUNT">
    <parameter name="account.name">
        <entity-set-reference entitySetId="AccountEntitySet" />
    </parameter>
    <fulfillment urlTemplate="https://www.xelion.com/account{?accountType}">
        <parameter-mapping
            intentParameter="account.name"
            urlParameter="accountType" />
    </fulfillment>
</action>

<action intentName="actions.intent.OPEN_APP_FEATURE">
    <parameter name="feature">
        <entity-set-reference entitySetId="FeatureEntitySet" />
    </parameter>
    <fulfillment urlTemplate="https://www.xelion.com/open{?featureName}">
        <parameter-mapping
            entityMatchRequired="true"
            intentParameter="feature"
            urlParameter="featureName" />
    </fulfillment>
</action>


<entity-set entitySetId="EntitySet">

    <!-- For each entity you can specify the name, alternate names and the identifier -->
    <!-- The identifier is the value that will be added to the action uri. -->
    <!-- For our sample we map the supported entities with the class FitActivity.Type  -->
    <entity
        name="start"
        identifier="START" />
    <entity
        name="stop"
        identifier="STOP" />

</entity-set>
<entity-set entitySetId="FeatureEntitySet">
    <entity
        name="call"
        alternateName="@array/callSynopsis"
        identifier="CALL" />
    <entity
        name="history"
        identifier="HISTORY" />
</entity-set>
<entity-set entitySetId="AccountEntitySet">
    <entity
        name="utility"
        identifier="UTILITY" />
    <entity
        name="sales"
        identifier="SALES" />
</entity-set>

</actions>

现在,如果我尝试:“获取 Dialer Xelion 帐户”,这将触发 GET_ACCOUNT 。

如果我尝试“在 Dialer Xelion 上打开历史记录”它也会识别该功能并打开应用程序。

但它不适用于:“Open Call on Dialer Xelion” 如您所见,我在 FeatureEntitySet 中有它,那么可能是什么问题?

同样在 App Actions Test Tool v3.0.0 中,如果我选择 OPEN_APP_FEATURE 它只显示:“历史”我可以修改它,但如果我更新它会保持不变。请帮忙

在此处输入图像描述

我还为 getAccount 添加了一个 AccountEntitySet,但这也没有显示。我究竟做错了什么?

在此处输入图像描述

标签: androidjsonvoice-recognitionvoiceapp-actions

解决方案


现在应该解决这个问题。此外,包含的 JSON 只是一个示例,不打算使用您的任何自定义值进行更新。

继续解决此问题的一些建议:

  1. 在三个地方验证 SLICE_AUTHORITY确保 SliceProvider 扩展类中的 SLICE_AUTHORITY 与android:authoritiesAndroidManifest.xml 文件和 actions.xml 声明中的匹配。
  2. 尝试新鲜样品。如果这些步骤都不起作用。尝试Fitness Android 示例并向后工作以比较和识别您的应用程序中的差距。

如果 SLICE_AUTHORITY(#2) 最终成为这里的问题,请告诉我。


推荐阅读