MoEngageSDKRichNotification

@objc
public class MoEngageSDKRichNotification : NSObject

Handles RichNotification

  • Method to handle rich Notification by downloading the resources and tracking impression.

    Declaration

    Swift

    @objc
    public static func handle(richNotificationRequest request: UNNotificationRequest, withContentHandler contentHandler: @escaping contentHandler)

    Parameters

    request

    UNNotificationRequest instance that contains remote notification content

    contentHandler

    completion block with updated notification content

  • Method to add Custom Push Template to the Notification Content Extension ViewController

    Must be called on the main thread: the template is added to controller‘s view hierarchy.

    Usage Example

    class NotificationViewController: UIViewController, UNNotificationContentExtension {
        func didReceive(_ notification: UNNotification) {
            MoEngageSDKRichNotification.addPushTemplate(toController: self, withNotification: notification)
        }
    }
    

    Declaration

    Swift

    @MainActor
    @objc
    public static func addPushTemplate(toController controller: UIViewController, withNotification notification: UNNotification)

    Parameters

    controller

    UIViewController instance to which the template needs to be added

    notification

    Remote notification

  • Set the App Group ID for sharing information between app and extension target.

    Declaration

    Swift

    @objc
    public static func setAppGroupID(_ appGroupID: String)

    Parameters

    appGroupID

    Pass the same value that is set for MoEngageSDKConfig.appGroupID instance.