Notification.getPayload()

The ZohoSalesIQ.Notification.getPayload() API retrieves the payload information associated with a notification when the user taps the notification. 

Note: 

Parameters

  • info -  A dictionary with the information associated with the notification.
  • completion - A closure that takes an optional `SalesIQNotificationPayload` parameter, representing the payload object retrieved from the notification.

 

Syntax

CopiedZohoSalesIQ.Notification.getPayload(_ info: [AnyHashable: Any]?, completion: (SIQNotificationPayload?) -> Void) 

Example

CopiedZohoSalesIQ.Notification.getPayload(response.notification.request.content.userInfo, completion: { object in
    if let chatPayload = object as? SalesIQChatNotificationPayload {
        ZohoSalesIQ.Chat.open(with: chatPayload)
        //Use ZohoSalesIQ.Chat.open() API to open the tapped notification chat
        
    } else if let endChatPayload = object as? SalesIQEndChatNotificationPayload {
        ZohoSalesIQ.Chat.open(with: endChatPayload)
        //Use ZohoSalesIQ.Chat.open() API to open the tapped notification chat
        
    } else if let visitorHistoryChatPayload = object as? SalesIQVisitorHistoryNotificationPayload {

    }
})​