简体   繁体   中英

What is the proper syntax for testing app actions via voice using google assistant?

I am currently writing an Android app in Kotlin to test out the new built in app actions provided by Google. At the moment, looking at actions.intent.GET_ACCOUNT.

I already have Android Studio, my google assistant and my device all connected with the same developer account. I have also uploaded a draft onto the play store with the same package name. I am able to get the app action to run with the test tool but not able to invoke it via voice using Google Assistant.

I have also consulted this link for help but no luck Android App Actions does not work with voice command

What I am saying into Google Assistant is something along the lines of "Hey Google view my account with Big Money". However, all I get is an online search result. Is there something obvious that I am missing? Thanks!

My Manifest:

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
    <meta-data android:name="com.google.android.actions" android:resource="@xml/actions" />

    <activity
            android:name=".views.MainActivity"
            android:exported="true"
            android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>

            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>

        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data
                    android:scheme="http"
                    android:host="martymoneybank.com"
                    android:pathPattern="/account"/>
        </intent-filter>

    </activity>
</application>

My Action.xml:

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

    <fulfillment urlTemplate="http://martymoneybank.com/account{?accountType}">
        <parameter-mapping
                intentParameter="account.name"
                urlParameter="accountType" />
    </fulfillment>
</action>

Test Tool:

Test Tool View

Here are the general troubleshooting steps for this kind of situation. If it works via the Studio Test Tool, but it doesn't work via voice, then there's two potential issues:

  1. You are using the wrong (or an unsupported) phrase that Assistant cannot match to the App Action. To find example queries, go here , find the Assistant intent and look at the example queries. Eg. 在此处输入图片说明

    However, in your case, GET_ACCOUNT does not have any example queries so please file a bug for this here .

  2. It's a bug on the Assistant side. If you try the example queries and it still doesn't work (but it works fine via the Studio Test Tool), then please file an issue .


That said, for GET_ACCOUNT could you try and see if these phases work (its also worth noting that you can use the keyboard to enter the phrases if Assistant is having any issues transcribing what you are saying, of course without the "hey google"):

hey google, get savings account balance using Big Money

or

hey google, check my savings account balance on Big Money

or

hey google, ask Big Money to tell me my savings account balance

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