Notification.getPayload()
Note: This API is supported by SDK version 8.1.0.
The ZohoSalesIQ.Notification.getPayload() API parses the map that was received from the Firebase push message to the SalesIQNotificationPayload map. This API can be used when the notifications need to be created on your own.
The API needs to be handled using the onMessage() method from the firebase.
Syntax
CopiedZohoSalesIQ.Notification.getPayload(map: object, callback: (result: ZSIQNotificationPayloadResult) => void)
Example
CopiedZohoSalesIQ.Notification.getPayload(remoteMessage.data, (result) => {
if (result.type == "chat") {
// Handle you chat notification
} else if (result.type == "endChatDetails") {
// Handle you end chat notification
} else if (result.type == "visitorHistory") {
// Handle you visitor history notification
} else {
// Not a SalesIQ notification
}
});