Rich Notifications are notification type which supports image, gif, video content. Dengage SDK supports varieties of contents and handles notification.
Supports:
To support Rich Notifications, application needs to create Notification Service Extension.
Referrer: Apple Doc
Referrer: Supported FIle Types
File > New > Target
Notification Service Extension
then press Next
.DengageNotificationServiceExtension
and press Finish
.Cancel
on the Activate scheme prompt.NotificationService.swift
and replace the whole file contents with the below code. override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if let bestAttemptContent = bestAttemptContent {
// add this line of code
Dengage.didReceiveNotificationExtentionRequest(receivedRequest: request, with: bestAttemptContent)
contentHandler(bestAttemptContent)
}
}