chatEventChannel
This channel holds events related to chat operations.
Events keys:
| Property | Datatype | Description |
| eventName | String | Name of the event. Events are listed below. |
| chat | Map | Chat details. The keys are listed below |
| chatAction | Map | Chat Action details. The keys are listed below |
Supported Events:
| Event Name | Invoked when |
| chatOpened | a chat is started by the visitor. |
| chatClosed | a chat ends. |
| chatAttended | a chat is picked up. |
| chatMissed | a chat is missed. |
| chatReopened | a chat is reopened. |
| chatRatingReceived | a chat is rated by the visitor after the chat is closed. |
| chatFeedbackReceived | feedback is given for a chat after it is closed. |
| performChatAction | a chat action is to be executed. |
| chatQueuePositionChanged | a current queue position changes |
| chatUnreadCountChanged | the unread count is changed |
| handleURL | a URL in the chat is clicked |
Chat details:
| Key | Datatype | Description |
| id | String | ID of the chat |
| question | String | The question with which the chat was initiated |
| attenderName | String | Name of the chat attender |
| attenderEmail | String | Email of the chat attender |
| attenderID | String | ID of the chat attender |
| departmentName | String | Name of the department to which the chat is associated |
| feedback | String | Feedback provided for the chat |
| lastMessage | String | Last message in the chat |
| status | String | The status of the chat |
| rating | String | Rating given for the chat |
| unreadCount | int | Unread message count for the chat |
| isBotAttender | bool | Flag to check if the last chat was attended by a bot |
| lastMessageSender | String | Name of the last message sender |
| lastMessageTime | double | Time of the last message in chat |
| queuePosition | int | Position of the chat in current queue |
Chat Action:
| Key | Datatype | Description |
| name | String | Value corresponding to the "name" key used in bot script. |
| clientActionName | String | Name of the action with which it was registered. |
| elementID | String | Element ID of card. |
| label | String | Label value of the button. |
| actionUUID | String | Unique 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;
}
});