简体   繁体   中英

OPEN_APP_FEATURE action not working through voice command [Works perfactly via App Actions Test Tool]

I have implemented actions.intent.OPEN_APP_FEATURE in my app with SLICE provider.
Here is how my actions.xml look likes.

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

        <fulfillment
            fulfillmentMode="actions.fulfillment.SLICE"
            urlTemplate="content://com.sa.actiondemo.slices.provider/{?featureName}">

            <parameter-mapping
                intentParameter="feature"
                required="true"
                urlParameter="featureName" />
        </fulfillment>

        <fulfillment
            fulfillmentMode="actions.fulfillment.DEEPLINK"
            urlTemplate="https://actiondemo.sa.com/{?featureName}">

            <parameter-mapping
                intentParameter="feature"
                urlParameter="featureName" />
        </fulfillment>

        <parameter name="feature">
            <entity-set-reference entitySetId="FeatureEntitySet" />
        </parameter>

</action> 

In the above code, FeatureEntitySet contains different features like Jog, Run, Dance, etc. which I want to open on my application and everything works perfectly via App Actions Test Tool.

While I creating preview on App Actions Test Tool it creates preview with default feature value History . Now when I change feature value History with other value as mentioned above it works well on AATT , but while testing on my device with voice command or using input text it is not working.

I want to add one more thing that the default feature value History of created preview works via voice command too but the other features from FeatureEntitySet not working.

Does anyone has faced this issue or anyone have an idea how to resolve this issue?

I faced the same issue and it was due to my App Name. Make sure your app name is unique enough and that Google Assistant spell it properly when you pronounce. Also, make sure the feature you invoke match your feature entity set (or parameter-binding if you use the new shortcuts )

Build and install your app on your test device. Then in App Actions Test Tool, set the app name and click Create Preview.

Then open Google Assistant app on your device and tap on the keyboard icon, and type your request: open <feature name> in <app name>

If this works, the voice command should work too. You can repeat the request by taping on the mic icon. Double check that the spelling is correct when you speak to the assistant.

How does it works?

In the background Google Assistant recognise that the first word is "open" so it will look for an app name and a feature name, then check them against its database to see if this tuple match something on your phone. this is why it is important that both the feature and the app name can be recognised properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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