0

I want to show a widget in Google Assistant. After searching through all the BIIs, I found there isn't one for my use case. Is this a thing that is possible, or do I have to go through a BII?

The documentation states that it is possible through a "custom intent configured for widget fulfillment" but they don't explain how to do that.

I tried creating a capability with a custom intent like so:

    <capability android:name="custom.actions.intent.SOMETHING">
        <app-widget
            android:identifier="SOMETHING_WIDGET"
            android:targetClass="com.example.Widget"
            android:targetPackage="com.example">

            <extra
                android:name="hasTts"
                android:value="true" />
        </app-widget>

        <intent
            android:identifier="SOMETHING_FALLBACK"
            android:targetClass="com.example.FallbackActivity"
            android:targetPackage="com.example" />
    </capability>

And I created this shortcut:

    <shortcut
        android:shortcutId="SOMETHING_SHORTCUT"
        android:shortcutShortLabel="@string/ShortcutShortLabel">
        <capability-binding android:key="custom.actions.intent.SOMETHING" />
    </shortcut>

Now here is the problem. If I do it this way (static shortcut) it doesn't even appear either on the launcher nor the GA shortcuts page.

On the dynamic shortcut route, I also tried to do what was suggested in this question, deep linking to GA directly. This works but for my account only. No other user can get the shortcut to appear on the GA shortcuts list.

If I add the following dependency as the documentation suggests:

implementation("androidx.core:core-google-shortcuts:1.1.0")

Attempting to invoke the dynamic shortcut after that dependency is added results in Google Assistant trying to load shortly before cancelling out with the following message in logcat:

Unsupported client op: ui.SHOW_APP_WIDGET. Ignoring.
Successfully executed ui.SHOW_APP_WIDGET. Status: IGNORE

Any help is appreciated, thanks!

Stav
  • 1
  • 2

0 Answers0