Notification.enablePush()
This API can be used to enable push notifications for the embedded mobile SDK. Once enabled, you will be notified every time a visitor initiates a chat, a trigger rule is set off and every time a visitor leaves your mobile app. It is necessary that you invoke this API right after the FCM token is refreshed.
PARAMETERS
- token: Your application's FCM token.
- isTestDevice: Whether it is a test build or release build.
Note: You can send the test notification message from SETTINGS --> WEBSITES --> <WEBSITE NAME> --> LIVE CHAT FOR MOBILE APPS --> ANDROID --> SEND TEST NOTIFICATION.
Syntax:
CopiedZohoSalesIQ.Notification.enablePush(String token, boolean isTestDevice);
Example:
Copiedpublic class MyInstanceIDListenerService extends FirebaseInstanceIdService
{
@Override
public void onTokenRefresh()
{
String token = FirebaseInstanceId.getInstance().getToken();
ZohoSalesIQ.Notification.enablePush(token,true);
}
}