Display map in Viber bot response

391 Views Asked by At

The response to a query is a list of local addresses. I am returning this list as a keyboard. It would be more helpful to the user if I could display the addresses on a Google map or an Open Street Map (this is preferred). Is this possible with the current Viber API?

The alternate would be to generate an image on the server with the addresses pinned. The image would not be as useful because the user would not be able to zoom or pan.

Thanks

2

There are 2 best solutions below

0
On

No, it is not possible.

But you can send single location on map using Location message.

Also, you can try to build Carousel Content message that will contain messages with type = location, but not sure if that will work.

0
On

You can do a workaround.

Open a partial-size browser. The link for the browser would be a self-hosted map with the desired pins. You still have to manage to pass the data somehow to the map.

{
            Columns: 6,
            Rows: 1,
            Text: `text`,
            ActionType: "open-url",
            ActionBody: `https://your-map-url.com`,
            BgColor: `color`,
            OpenURLType: "internal",
            InternalBrowser: {
                Mode: 'partial-size',
            },
    },