Reputation: 508
I'm working on integrating Google Assistant for an Android app built using Flutter. I want to trigger some code in the app using a phrase like "Hey Google, check status in My Cat app". It should go first to native Android, then I'll pass it to Flutter.
The solution seems to be app actions. I've followed the prerequisites in the documentation, but the tooling is broken and I can't figure out how to make it work.
Regarding the conditions
shortcuts.xml
res nor the meta-data
in the manifest.Google Assistant plugin v3.2.2
Preview Creation Error Status Code: 500 Message: Internal error encountered.
Create shortcuts.xml
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" />
app/src/main/res/xml/shortcuts.xml
is below<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<capability android:name="actions.intent.GET_SERVICE_OBSERVATION">
<intent
android:targetPackage="cat.my.app"
android:targetClass="cat.my.app.MainActivity">
<parameter
android:name="serviceObservation.measuredProperty.name"
android:key="name" />
<parameter
android:name="serviceObservation.aboutService.description"
android:key="description" />
<parameter
android:name="serviceObservation.endTime"
android:key="endTime"/>
<parameter
android:name="serviceObservation.startTime"
android:key="startTime"/>
</intent>
</capability>
<shortcut
android:shortcutId="status"
android:shortcutShortLabel="@string/status_short_label"
android:shortcutLongLabel="@string/status_long_label">
<capability-binding android:key="actions.intent.GET_SERVICE_OBSERVATION">
<parameter-binding
android:key="serviceObservation.measuredProperty.name"
android:value="@array/status_synonyms" />
</capability-binding>
</shortcut>
</shortcuts>
Do you have ideas what could be wrong? If somebody has greater experience with Google Assistant, it might be helpful to understand
shortcuts.xml
be uploaded to Google Play? Would this enable the app action for testing?Many thanks!
Upvotes: 1
Views: 207