.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 | any of the operators are online. |
EVENT_OPERATORS_OFFLINE | all the operators are offline. |
EVENT_VISITOR_IPBLOCKED | the visitor's IP is blocked. |
EVENT_FEEDBACK_RECEIVED | feedback is given by the visitor |
EVENT_RATING_RECEIVED | a chat is rated by the visitor |
EVENT_PERFORM_CHATACTION | a chat action is to be executed. Learn More |
EVENT_CUSTOMTRIGGER | a custom trigger is executed. Learn More |
EVENT_CHAT_UNREAD_COUNT_CHANGED | the unread count is changed |
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 |
Example:
CopiedZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_SUPPORT_OPENED, () =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_SUPPORT_CLOSED, () =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_CHATVIEW_OPENED, (chatID)=>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_CHATVIEW_CLOSED, (chatID) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_CHAT_OPENED,(visitorChat) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_CHAT_CLOSED,(visitorChat) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_CHAT_REOPENED, (visitorChat) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT.CHAT_QUEUE_POSITION_CHANGED, (visitorChat) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_CHAT_ATTENDED, (visitorChat) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_CHAT_MISSED, (visitorChat) => {
//your code
});
// Deprecated, use EVENT_RESOURCE_OPENED instead
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_ARTICLE_OPENED, (articleID) =>
{
//your code
});
// Deprecated, use EVENT_RESOURCE_CLOSED instead
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_ARTICLE_CLOSED, (articleID) =>
{
//your code
});
// Deprecated, use EVENT_RESOURCE_LIKED instead
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_ARTICLE_LIKED, (articleID) =>
{
//your code
});
// Deprecated, use EVENT_RESOURCE_DISLIKED instead
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_ARTICLE_DISLIKED, (articleID) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_RESOURCE_OPENED, (resource) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_RESOURCE_CLOSED, (resource) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_RESOURCE_LIKED, (resource) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_RESOURCE_DISLIKED, (resource) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_OPERATORS_ONLINE, () =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_OPERATORS_OFFLINE, () =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_VISITOR_IPBLOCKED, () =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_FEEDBACK_RECEIVED, (visitorChat) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_RATING_RECEIVED, (visitorChat) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_CUSTOMTRIGGER, (triggerInformation) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_CHAT_UNREAD_COUNT_CHANGED, (unreadCount) =>
{
//your code
});
ZohoSalesIQ.addEventListener(ZohoSalesIQ.EVENT_HANDLE_URL, (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
});