Skip to main content

.addEventListener()

The Mobilisten React-Native SDK provides various events that developers can use to perform customized actions.

Supported events:

EventInvoked when​

EVENT.SUPPORT_OPENED

the user opens the SDK

EVENT.SUPPORT_CLOSED

the user closes the SDK

EVENT.CHATVIEW_OPENED

a chat window is opened

EVENT.CHATVIEW_CLOSED

a chat window is closed

EVENT.CHAT_OPENED

a chat is initiated

EVENT.CHAT_CLOSED

a chat is ended

​​

EVENT.CHAT_MISSED

a chat is missed
EVENT.CHAT_ATTENDEDa chat is picked up
EVENT.CHAT_REOPENEDa chat is reopened
EVENT.CHAT_QUEUE_POSITION_CHANGEDthe position in the queue of a queued chat changes
EVENT.ARTICLE_OPENED (Deprecated) an article is opened
EVENT.ARTICLE_CLOSED (Deprecated) an article is closed
EVENT.ARTICLE_LIKED (Deprecated) an article is liked
EVENT.ARTICLE_DISLIKED (Deprecated) an article is disliked
EVENT.RESOURCE_OPENEDa resource is opened
EVENT.RESOURCE_CLOSEDa resource is closed
EVENT.RESOURCE_LIKEDa resource is liked
EVENT.RESOURCE_DISLIKEDa resource is disliked
EVENT.OPERATORS_ONLINEoperators or bots are available
EVENT.OPERATORS_OFFLINEall operators are offline
EVENT.VISITOR_IPBLOCKEDvisitor is IP Blocked
EVENT.FEEDBACK_RECEIVEDvisitor provides feedback for a chat
EVENT.RATING_RECEIVEDvisitor rates a chat
EVENT.PERFORM_CHATACTIONa chat action is to be executed. Learn More
EVENT.CUSTOMTRIGGERA custom trigger is to be executed. Learn More.
EVENT.HANDLE_URL​a URL in the chat is clicked​
EVENT.HANDLE_CUSTOM_LAUNCHER_VISIBILITYShow/hide your custom launcher with the triggered boolean value

Usage

CopiedZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.SUPPORT_OPENED, function(){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.SUPPORT_CLOSED, function(){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.CHATVIEW_OPENED, function(referenceID){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.CHATVIEW_CLOSED, function(referenceID){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.CHAT_OPENED, function(chat){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.CHAT_CLOSED, function(chat){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.CHAT_MISSED, function(chat){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.CHAT_ATTENDED, function(chat){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.CHAT_REOPENED, function(chat){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.CHAT_QUEUE_POSITION_CHANGED, function(chat){
	// your code goes here
});
// Deprecated, use EVENT.RESOURCE_OPENED instead
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.ARTICLE_OPENED, function(articleID){
	// your code goes here
});
// Deprecated, use EVENT.RESOURCE_CLOSED instead
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.ARTICLE_CLOSED, function(articleID){
	// your code goes here
});
// Deprecated, use EVENT.RESOURCE_LIKED instead
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.ARTICLE_LIKED, function(articleID){
	// your code goes here
});
// Deprecated, use EVENT.RESOURCE_DISLIKED instead
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.ARTICLE_DISLIKED, function(articleID){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.RESOURCE_OPENED, function(resource) {
      // your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.RESOURCE_CLOSED, function(resource) {
      // your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.RESOURCE_LIKED, function(resource) {
      // your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.RESOURCE_DISLIKED, function(resource) {
      // your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.OPERATORS_ONLINE, function(){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.OPERATORS_OFFLINE, function(){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.VISITOR_IPBLOCKED, function(){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.FEEDBACK_RECEIVED, function(chat){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.RATING_RECEIVED, function(chat){
	// your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.CUSTOMTRIGGER, function(triggerInformation){
       // your code goes here
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.HANDLE_URL, function(chat) {
    // chat.url will get the clicked url 
    // chat object has the chat details Eg. chat.question
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_HANDLE_CUSTOM_LAUNCHER_VISIBILITY, (visible){
        //your code
});