eventChannel

This event channel provides the events listed below.

Properties:

Event Keys:

PropertyDatatypeDescription
eventNameStringName of the event. List of events listed below.
chatIDStringId of the chat for which operation is performed (applicable only for chatViewOpened and chatViewClosed event)
triggerNameStringName of the trigger (applicable only for customTrigger event)
visitorInformationMapVisitor Object. List of properties are listed below (applicable only for customTrigger event)

Supported Events:

eventNameInvoked when
supportOpenedThe user opens the SDK.
supportClosedThe user closes or comes out of the SDK.
operatorsOnlineAny of the operators are online.
operatorsOfflineAll of the operators are offline.
visitorIPBlockedThe visitor's IP is blocked.
chatViewOpenedA chat window is opened
chatViewCloseda chat window is closed.
customTriggerCorresponding trigger criteria matches.

​Visitor Information:

KeyDescription
nameName of the visitor
emailThe email address of the visitor
phoneThe contact number of the visitor
osOperating system used by the visitor.
countryCodeCountry code of the visitor.
ipThe IP address of the visitor
regionRegion of the visitor (APAC/CANADA/EMEA/NA/SA).
cityCity(Location) of the visitor.
stateState(Location) of the visitor
numberOfChatsNumber of previously closed chats had by the visitor
numberOfVisitsThe number of times the visitor has used the app.
noOfDaysVisitedNumber of days the visitor has used the app
totalTimeSpentThe total time duration that the visitor had spent on your site(in milliseconds).
firstVisitTimeThe first time (Unix time) that the visitor visited your site.
lastVisitTimeThe 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;
    }
});