SalesIQChatListener

The Mobilisten Android SDK provides an interface for various chat event callbacks to help developers track different actions related to chat 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());

MethodInvoked 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 chat is rated by the visitor after the chat is closed. This API returns the chat(of type VisitorChat) missed.
handleFeedback()feedback is given for a chat after it is closed. This API returns the chat(of type VisitorChat) missed.

 

 

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
  }
}