How to integrate the OPEN_APP_FEATURE action into an Android application?
Asked Answered
E

2

8

I want to be able to launch some features of my Android app ("Start", "Stop"), through voice commands from Google Assistant.

  1. What are the next steps to be able to launch these features from Google Assistant?
  2. What are the natural language queries supported by this Open App Feature?

I have integrated actions.intent.OPEN_APP_FEATURE into my app and tested it successfully through the App Actions Test Tool in Android Studio.

My actions.xml:

<?xml version="1.0" encoding="utf-8"?>
<actions>
    <action intentName="actions.intent.OPEN_APP_FEATURE">
        <fulfillment urlTemplate="http://www.my-app.com/{?featureName}">
            <parameter-mapping
                intentParameter="feature"
                urlParameter="featureName" />
        </fulfillment>

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

    <entity-set entitySetId="FeatureEntitySet">
        <entity
            name="@string/start_capture"
            identifier="START" />
        <entity
            name="@string/stop_capture"
            identifier="STOP" />
    </entity-set>
</actions>

When asking Google Assistant something like "Open start from MyApp" I was expecting the same behavior as when testing through the App Actions Test Tool (open the feature of the app), but Google Assistant provides generic web results instead.

Emaemaciate answered 20/6, 2019 at 8:15 Comment(0)
E
4

It turns out, that there is a bug preventing from triggering an Open App Feature from Google Assistant.

Emaemaciate answered 25/6, 2019 at 7:14 Comment(0)
E
1

As per the docs for OPEN_APP_FEATURE:

Supported entities

You must specify entities for feature.

Therefore you should try providing the values your app supports for the feature parameter using inline inventory. This allows you to tell Assistant what values to expect for that parameter. There is also an example of this in the sample app here.

The docs should definitely have sample queries to better guide how to test this (will see if we can get that updated).

I believe what you are testing should work - "Open [feature] on MyApp". If it's not working via voice but it is working via Test Tool then that might be a bug. Only thing to check is the invocation name set up in the Test Tool matches what you are testing with ("MyApp" above). Otherwise you can file a bug here.

Extramundane answered 20/6, 2019 at 13:14 Comment(4)
Thanks @AdamK, but I can't find in this doc what could be wrong in my actions.xml when specifying the inline inventory for feature. And still don't see anything in the doc saying which natural language query triggers this action.Jibber
Yes the docs definitely should have sample queries. Let me look into sample queries. I believe what you are testing should work - "Open [feature] on MyApp". If it's not working via voice but it is working via Test Tool then that might be a bug. Only thing to check is the invocation name set up in the Test Tool matches what you're testing with ("MyApp" above). Otherwise you can file a bug here: issuetracker.google.com/issues/…Extramundane
@JérômePietri - confirmed triggering via voice looks to be broken at this point. You can file a bug on the link I sent but we are looking into it further on our side already.Extramundane
Thanks again @AdamK. A bug has been filed in the meantime: issuetracker.google.com/issues/135714718Jibber

© 2022 - 2024 — McMap. All rights reserved.