Rich Notifications

Rich Notifications is a notification type which supports image, gif, video content. D·engage SDK supports varieties of contents and handles notification.


  • Image
  • Video
  • Gif

To support Rich Notifications, application needs to create Notification Service Extension.

on Android, there is no special setup required for rich notifications.

Referrer: Apple Doc

Referrer: Supported File Types


Adding Notification Service Extension

1.1 In Xcode Select File > New > Target

1.2 Select Notification Service Extension then press Next.

1.3 Enter the product name as DengageNotificationServiceExtension and press Finish.

1.4 Press Cancel on the Activate scheme prompt.

1.5 Open NotificationService.swift and replace the whole file contents with the below code.

import UserNotifications
import Dengage
class NotificationService: UNNotificationServiceExtension {

    var contentHandler: ((UNNotificationContent) -> Void)?
    var bestAttemptContent: UNMutableNotificationContent?

    override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
        self.contentHandler = contentHandler
        bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
        Dengage.didReceiveNotificationRequest(bestAttemptContent, withContentHandler: contentHandler)
    override func serviceExtensionTimeWillExpire() {
        // Called just before the extension will be terminated by the system.
        // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
        if let contentHandler = contentHandler, let bestAttemptContent =  bestAttemptContent {

1.6 It should be added to the PodFile.

target 'NotificationService' do
  # Comment the next line if you don't want to use dynamic frameworks
pod 'Dengage'
  # Pods for