4

I'm trying to build App Actions using custom intent but there's not much help that I can get from the Google's document.

I am able to run the intent and catch the parameter using the App Action Test Tool but when I try to run the custom intent by using interacting directly with Google Assistant like: "Hey Google, open [app name] and [make a cake at 12:00:00]", the console said: "Sorry, I don't understand".

I've been trying to follow some documents and tutorials and have XML files as below. If anyone has experience on this, please share it. Thank you in advance.

shortcuts.xml

<capability
        android:name="custom.actions.intent.MY_CUSTOM_INTENT"
        app:queryPatterns="@array/SampleQueries">
        <intent
            android:action="android.intent.action.VIEW"
            android:targetPackage="com.example.appId"
            android:targetClass="com.example.appId.MainActivity">
            <parameter
                android:name="time"
                android:key="time"
                android:mimeType="https://schema.org/Time" />
        </intent>
</capability>


<shortcut
    android:shortcutId="MY_CUSTOM_INTENT"
    android:shortcutShortLabel="@string/MY_CUSTOM_INTENT">
    <capability-binding android:key="custom.actions.intent.MY_CUSTOM_INTENT">
        <parameter-binding
            android:key="time"
            android:value="@string/my_custom_intent"/>
    </capability-binding>
</shortcut>

strings.xml

<string-array name="SampleQueries">
    <item>make a cake at $time</item>
    <item>make a cake</item>
</string-array>

<string name="my_custom_intent">my_custom_intent</string>

<string name="MY_CUSTOM_INTENT">MY_CUSTOM_INTENT</string>

Run custom intent of App Actions from Google assistant and catch all the parameters from the input.

1 Answers1

0

Do you use the same language package? Because I get the error when I switch the languge. Try it with only en as language and also change it in your assistant

Happy
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 03 '23 at 17:43