notification.getPayload()
Note: This API is supported from version 5.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.
Example
CopiedZohoSalesIQ.notification.getPayload(remoteMessage.data).then((payload) => {
if (payload != null) {
if (payload is SalesIQNotificationPayloadChat) {
// Handle chat notifications
} else if (payload is SalesIQNotificationPayloadEndChatDetails) {
// Handle end chat notifications
} else if (payload is SalesIQNotificationPayloadVisitorHistory) {
// Handle visitor history notifications
} else {
// Handle your own notifications
}
}
})