chatEventChannel

​This channel holds events related to chat operations.

Events keys:

PropertyDatatypeDescription
eventNameStringName of the event. Events are listed below.
chatMapChat details. The keys are listed below
chatActionMapChat Action details. The keys are listed below

Supported Events:

Event NameInvoked when
chatOpeneda chat is started by the visitor.
chatCloseda chat ends.
chatAttendeda chat is picked up.
chatMisseda chat is missed.
chatReopeneda chat is reopened.
chatRatingReceiveda chat is rated by the visitor after the chat is closed.
chatFeedbackReceivedfeedback is given for a chat after it is closed.
performChatActiona chat action is to be executed.
chatQueuePositionChangeda current queue position changes
chatUnreadCountChangedthe unread count is changed
handleURLa URL in the chat is clicked

​Chat details:

KeyDatatypeDescription
idStringID of the chat
questionStringThe question with which the chat was initiated
attenderNameStringName of the chat attender
attenderEmailStringEmail of the chat attender
attenderIDStringID of the chat attender
departmentNameStringName of the department to which the chat is associated
feedbackStringFeedback provided for the chat
lastMessageStringLast message in the chat
statusStringThe status of the chat
ratingStringRating given for the chat
unreadCountintUnread message count for the chat
isBotAttenderboolFlag to check if the last chat was attended by a bot
lastMessageSenderStringName of the last message sender
lastMessageTimedoubleTime of the last message in chat
queuePositionintPosition of the chat in current queue

Chat Action:

KeyDatatypeDescription
nameStringValue corresponding to the "name" key used in bot script.
clientActionNameStringName of the action with which it was registered.
elementIDStringElement ID of card.
labelStringLabel value of the button.
actionUUIDStringUnique ID for the action.

Syntax

CopiedZohoSalesIQ.chatEventChannel.listen((event) {
  // your code to handle events
});

Usage

CopiedZohoSalesIQ.chatEventChannel.listen((event) {
    switch (event["eventName"]) {
        case SIQEvent.chatOpened:
            var chatDetails = event["chat"];
            // your code to handle event
            break;
        case SIQEvent.chatClosed:
            var chatDetails = event["chat"];
            // your code to handle event
            break;
        case SIQEvent.chatAttended:
            var chatDetails = event["chat"];
            // your code to handle event
            break;
        case SIQEvent.chatMissed:
            var chatDetails = event["chat"];
            // your code to handle event
            break;
        case SIQEvent.chatReopened:
            var chatDetails = event["chat"];
            // your code to handle event
            break;
        case SIQEvent.chatRatingReceived:
            var chatDetails = event["chat"];
            // your code to handle event
            break;
        case SIQEvent.chatFeedbackReceived:
            var chatDetails = event["chat"];
            // your code to handle event
            break;
        case SIQEvent.chatQueuePositionChange:
            var chatDetails = event["chat"];
            // your code to handle event
            break;
        case SIQEvent.performChatAction:
            var actionDetails = event["chatAction"];
            // your code to handle event
            break;
        case SIQEvent.chatUnreadCountChanged:
            var unreadCount = event["unreadCount"];
            // your code to handle event
            break;
        case SIQEvent.handleURL:
             // your code to handle event
             break;
    }
});