eventChannel
This event channel provides the events listed below.
Properties:
Event Keys:
Property | Datatype | Description |
eventName | String | Name of the event. List of events listed below. |
chatID | String | Id of the chat for which operation is performed (applicable only for chatViewOpened and chatViewClosed event) |
triggerName | String | Name of the trigger (applicable only for customTrigger event) |
visitorInformation | Map | Visitor Object. List of properties are listed below (applicable only for customTrigger event) |
Supported Events:
eventName | Invoked when |
supportOpened | The user opens the SDK. |
supportClosed | The user closes or comes out of the SDK. |
operatorsOnline | Any of the operators are online. |
operatorsOffline | All of the operators are offline. |
visitorIPBlocked | The visitor's IP is blocked. |
chatViewOpened | A chat window is opened |
chatViewClosed | a chat window is closed. |
customTrigger | Corresponding trigger criteria matches. |
botTrigger | a bot has been triggered. |
customLauncherVisibility | Show/hide your custom launcher with the triggered boolean value |
​Visitor Information:
Key | Description |
name | Name of the visitor |
The email address of the visitor | |
phone | The contact number of the visitor |
os | Operating system used by the visitor. |
countryCode | Country code of the visitor. |
ip | The IP address of the visitor |
region | Region of the visitor (APAC/CANADA/EMEA/NA/SA). |
city | City(Location) of the visitor. |
state | State(Location) of the visitor |
numberOfChats | Number of previously closed chats had by the visitor |
numberOfVisits | The number of times the visitor has used the app. |
noOfDaysVisited | Number of days the visitor has used the app |
totalTimeSpent | The total time duration that the visitor had spent on your site(in milliseconds). |
firstVisitTime | The first time (Unix time) that the visitor visited your site. |
lastVisitTime | The last time (Unix time) that the visitor visited your site. |
Syntax
CopiedZohoSalesIQ.eventChannel.listen((event) {
// your code to handle events
});
Usage
CopiedZohoSalesIQ.eventChannel.listen((event) {
switch (event["eventName"]) {
case SIQEvent.supportOpened:
// your code to handle event
break;
case SIQEvent.supportClosed:
// your code to handle event
break;
case SIQEvent.chatviewOpened:
var chatID = event["chatID"];
//your code
break;
case SIQEvent.chatviewClosed:
var chatID = event["chatID"];
//your code
break;
case SIQEvent.operatorsOnline:
// your code to handle event
break;
case SIQEvent.operatorsOffline:
// your code to handle event
break;
case SIQEvent.visitorIPBlocked:
// your code to handle event
break;
case SIQEvent.customTrigger:
// your code to handle event
break;
case SIQEvent.botTrigger:
// your code to handle event
break;
case SIQEvent.customLauncherVisibility:
// your code to handle event
break;
}
});