Notification.setListener()

Note: 

  • This API is supported from version 7.1.0
  • It is recommended to set this listener inside the onCreate() method of your application class before invoking any APIs. 

This API allows you to register a callback that is to be invoked whenever an event is triggered regarding the notification. 

Supported events

MethodInvoked when
onBadgeChange() the count of the unread messages changes.
onClick

a notification is tapped.

Parameters

  • context – context of the current activity. 
  • payload – details of the notification.

Note: This method is called only when ZohoSalesIQ.ActionSource.App is set with ZohoSalesIQ.Notification.setActionSource(ZohoSalesIQ.ActionSource).

Example

CopiedZohoSalesIQ.Notification.setListener(new NotificationListener() {
    @Override 
    public void onBadgeChange(int count) {
        //Your code here
    }
    @Override
    public void onClick(@Nullable Context context, @NonNull SalesIQNotificationPayload payload) {
        // Your code here
    }
});