handleWidgetAction()

This event handler can be used to invoke a method when the visitor either clicks on the chat widget to initiate a chat or closes the chat window. 

PARAMETERS

isOpen: Status of the embedded chat widget ie., either open or closed.

  • True: When the visitor clicks on the chat widget to initiate a chat.
  • False: When the visitor closes the chat window.

Syntax:

CopiedhandleWidgetAction(boolean isOpen)

Example:

Copiedpublic class ChatInterface implements ChatActivityInterface {

@Override
public void handleWidgetAction(boolean isOpen) {
if(isOpen) {
            // Visitor enters the chat window
           }
else {
            // Visitor exits the chat window
     }
}
}