2
votes

I have implemented the App Actions in a demo app. It's working fine and I'm able to launch a specific screen using Google Assistant with queries like

Order pizza from Avocado

So I started to integrate Slice. When testing the Slice using SliceViewer, it works fine.

But when I try to invoke Slice from Google Assistant, it doesn't work.

Here is the snippet in the actions.xml

<action intentName="actions.intent.GET_ORDER">
    <fulfillment
        fulfillmentMode="actions.fulfillment.SLICE"
        urlTemplate="content://my.food.service/status" />

    <fulfillment
        fulfillmentMode="actions.fulfillment.DEEPLINK"
        urlTemplate="my://food/orders" />
</action>

The queries I used in Google Assistant are from the documentation

  • Ask Avocado to check my order
  • Check my order on Avocado

But neither works.

Also, after I added the above snippet to the actions.xml, I am not able to use the "App Actions Test Tool" plugin anymore. It says

Preview Creation Error Status Code: 400 Message: Precondition check failed. - Multiple URL templates for action 'actions.intent.GET_ORDER' have zero required parameters.

I'm using plugin version v1.1.0

So my question is: Is testing Slice through Google Assistant available? If not, when will it be available to develop and test?

2

2 Answers

2
votes

Is testing Slice through Google Assistant available? If not, when will it be available to develop and test?

Yes, developing/testing Slice fulfillment via Google Assistant using the Studio Test Tool should already work.

Can you try removing the DEEPLINK fulfillment block and see if that works? So your actions.xml would look like:

<action intentName="actions.intent.GET_ORDER">
    <fulfillment
        fulfillmentMode="actions.fulfillment.SLICE"
        urlTemplate="content://my.food.service/status" />    
</action>

Explanation: a particular <action> must have one, and only one <fulfillment> block that has zero <parameter> blocks that have required=true. Why? Because that becomes the "fallback" fulfillment mechanism as noted in the docs here:

You must provide one <fulfillment> without any required parameters as a fallback fulfillment.

As actions.intent.GET_ORDER doesn't accept any parameters, that means you can only ever have a single <fulfillment> block which can either be fulfilled via Slice or Deep Link, but not both.

1
votes

I have issues test slices with google assistant. My assistant is stuck on loading the reply while deeplink is working fine.