Skip to product menu
Skip to main content

​​Chat Actions

SalesIQActionListener can be used to acknowledge the success or failure of callback methods to the SDK. Follow the specified steps below to implement the listener:

Step 1:

Copied public class MySalesIQActionListener implements SalesIQActionListener {
    @Override
    public void handleCustomAction(SalesIQCustomAction customAction, SalesIQCustomActionListener listener) {
        //your code goes here

        //example actions
        if (paymentCompleted) {
            listener.onSuccess("payment success!");
        } else {
            listener.onFailure("payment failed");
        }
    }

Para​meters:

customAction:

It can be used to identify the element from which the action is performed. (elementID, name, label, clientActionName)​

elementIDId of an element. Value specified with the key "id" in elements tag will be returned
nameValue specified with the key "name" inside actions will be returned
labelValue specified with the key "label" inside actions will be returned
clientActionNameValue specified with the key "clientaction_name" inside actions will be returned

listener:

It can be used to invoke the callback to SDK end. (Until the callback is received, the loader will be shown for the default timeout of 30 seconds. The timeout can be changed using the API provided)​

Example:

  • listener.onSuccess()
  • listener.onFailure()
  • listener.onSuccess("success message")
  • listener.onFailure("failure message")

Step 2: 

Copied ZohoSalesIQ.ChatActions.setListener(new MySalesIQActionListener());

Note: Using this API after a successful callback from init() is optional.