actions-on-google / assistant-conversation-nodejs

A developer friendly way to fulfill Actions SDK handlers for the Google Assistant
https://actions-on-google.github.io/assistant-conversation-nodejs
Apache License 2.0
104 stars 27 forks source link

button link not showing when returing a card #47

Open fspegni opened 2 years ago

fspegni commented 2 years ago

Hello,

I'm having a hard time trying to return a conversational prompt with a card containing a link. I tried reading the documentation and followed one of your tests, but I can't get it working. This is an excerpt of my code:

    conv.add(new Card({
       title: "this is title",
       image: new Image({
         url: OPEN_STREET_MAP_LOGO,
         alt: 'Open Street Map logo',
       }),
       button: new Link({
         name: 'Learn more',
         open: {
           url: 'https://www.google.com/about/',
         },
       }),
    }));

This is the JSON returned by my webhook (copied from the simulator):

{
  "responseJson": {
    "session": { ... },
    "prompt": {
      "override": false,
      "content": {
        "card": {
          "title": "this is title",
          "image": {
            "alt": "Google app logo",
            "height": 0,
            "url": "https://wiki.openstreetmap.org/w/images/thumb/7/79/Public-images-osm_logo.svg/240px-Public-images-osm_logo.svg.png",
            "width": 0
          },
          "button": {
            "name": "Learn more",
            "open": {
              "url": "https://www.google.com/about/"
            }
          }
        }
      },
      "firstSimple": {
        "speech": "Here is a map for your project",
        "text": ""
      }
    }
  }
}

Below you can find the rendered card, without button. Am I doing something wrong here?

bug_conversational_agent