Open MessageBird widget chat from JS code

240 Views Asked by At

I'm using messagebird omnichannel widget for my website. And put the snippet code already. The widget runs great BTW.

I did saw toggleChat function, but it can only hide the chat window.

How can I force-open the chat widget from javascript code ?

1

There are 1 best solutions below

0
On BEST ANSWER

MessageBird developer is here :)

Good catch! There was a small issue with toggleChat method.

We just fixed it and deployed the fix, you can use toggleChat() now.

As you mentioned, toggleChat should do it - to open/hide the widget, but it didn't work. The issue that we had was the following: you had to pass true to open the chat and pass false to close it. It is not obvious when we have the name of the method like toggleChat, I agree! :)

Anyway, it's fixed but feel free to reach me if you have any other questions about the widget or our other products.