Closed sonlexqt closed 6 years ago
You have to call ask
only one time for intent, every others time are ignored.
So calling ask
with the string basicCard
you send a SimpleResponse
to dialogflow and the BasicCard is basically discarded.
Try to remove the conv.ask('basicCard');
Can you provide a larger code snippet?
@Edo78 are you sure ? Because in the sample code, we can call conv.ask
multiple times. Have you tried it ?
@Fleker thanks, I updated my issue with more code snippet.
@sonlexqt are you simulating using the Phone or Speaker surface? Visual responses are only available on screen surfaces (so only the Phone mode will work).
It should be selected like this on the simulator:
@Canain I'm simulating using the Phone surface:
I think the surface is not a problem because I can show Carousel
using my bot, just the BasicCard
doesn't appear.
Hm... That's really weird, because your code should work but the logs you posted show that only the basic card is sent and not the SimpleResponse
too which should look like:
{
"items": [
{
"simpleResponse": {
"textToSpeech": "basicCard"
}
},
{
"basicCard": {
"title": "DRUMQUIN PARK",
"subtitle": "Has 4 amenities",
"formattedText": "DRUMQUIN PARK has 4 amenities: 2 Baseball Diamonds, 1 BMX, 1 Playground, 1 Soccer Field, . What other park would you like to know more about?",
"image": {
"url": "https://www.miltonparks.com/Content/Upload/1ac37f71-a39e-4f04-9628-d02bf2a694b6/facility_photos_thumbnail/2564/d8c1a3feb1e94393ba9a8f46239f2cda.jpg",
"accessibilityText": "Image alternate text"
}
}
}
]
}
The response log you posted also should actually error out on the simulator as a SimpleResponse
is required.
This might be a caching issue. Can you verify the code is deploy and corresponds to the same logs? Also, on the simulator, if you click on a certain response, you can go to the RESPONSE
tab to get more information.
@sonlexqt Can you post working sample for the Carousel because I have not been able to get it to work
Using the
actions-on-google-nodejs
v2 library, I setup the webhook to send a BasicCard:When I test with Actions on Google simulator, this is shown: (the simple response is shown and the
BasicCard
isn't). When I check the console output this is what I got:I think the
BasicCard
is successfully sent but somehow Actions on Google simulator didn't show the card. Any suggestions ?