.addEventListener()
The Mobilisten React-Native SDK provides various events that developers can use to perform customized actions.
Supported events:
Event | Invoked 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_ATTENDED | a chat is picked up |
EVENT.CHAT_REOPENED | a chat is reopened |
EVENT.CHAT_QUEUE_POSITION_CHANGED | the 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_OPENED | a resource is opened |
EVENT.RESOURCE_CLOSED | a resource is closed |
EVENT.RESOURCE_LIKED | a resource is liked |
EVENT.RESOURCE_DISLIKED | a resource is disliked |
EVENT.OPERATORS_ONLINE | operators or bots are available |
EVENT.OPERATORS_OFFLINE | all operators are offline |
EVENT.VISITOR_IPBLOCKED | visitor is IP Blocked |
EVENT.FEEDBACK_RECEIVED | visitor provides feedback for a chat |
EVENT.RATING_RECEIVED | visitor rates a chat |
EVENT.PERFORM_CHATACTION | a chat action is to be executed. Learn More |
EVENT.CUSTOMTRIGGER | A custom trigger is to be executed. Learn More. |
EVENT.HANDLE_URL | a URL in the chat is clicked |
EVENT.HANDLE_CUSTOM_LAUNCHER_VISIBILITY | Show/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
});