SalesIQChatListener
The Mobilisten Android SDK provides an interface for various chat event callbacks to help developers track different chat-related actions like open, close performed by the app user. The 'SalesIQChatListener' invokes callback methods for various chat actions performed by the visitors.
VisitorChat object returned in the callback will hold the properties mentioned in the following link. The method returns an instance of the Visitor Chat class, which contains information related to the chat.
You need to follow the steps below to implement the chat event handler:
Step 1:
public class MySalesIQChatListener implements SalesIQChatListener
{
//override methods
}
Step 2:
ZohoSalesIQ.Chat.setListener(new MySalesIQChatListener());
Method | Invoked when​ |
handleChatViewOpen() | a chat window is opened |
handleChatViewClose() | a chat window is closed. |
handleChatOpened() | a chat is started by the visitor. |
handleChatClosed() | a chat ends. |
handleChatAttended() | a chat is picked up. |
handleChatMissed() | a chat is missed. |
handleChatReOpened() | a chat is reopened. |
handleRating() | a rating given for the chat |
handleFeedback() | a feedback provided for the chat |
handleQueuePositionChange() | the queue position of a chat is updated |
handleUri() | a URL is tapped/clicked in the chat |
Note: Using this API after a successful callback from init() is optional.
Example:
Copiedpublic class MySalesIQChatListener implements SalesIQChatListener {
@Override
public void handleChatViewOpen(String chatID) {
//your code
}
@Override
public void handleChatViewClose(String chatID) {
//your code
}
@Override
public void handleChatOpened(VisitorChat visitorChat) {
//your code
}
@Override
public void handleChatClosed(VisitorChat visitorChat) {
//your code
}
@Override
public void handleChatAttended(VisitorChat visitorChat) {
//your code
}
@Override
public void handleChatMissed(VisitorChat visitorChat) {
//your code
}
@Override
public void handleChatReOpened(VisitorChat visitorChat) {
//your code
}
@Override
public void handleRating(VisitorChat visitorChat) {
//your code
}
@Override
public void handleFeedback(VisitorChat visitorChat) {
//your code
}
@Override
public void handleQueuePositionChange(VisitorChat visitorChat) {
//your code
}
@Override
public boolean handleUri(Uri uri, VisitorChat visitorChat) {
// your code
return true; // return false to disable default behavior
}
}