MoEngageSDKMessaging

@objc
public class MoEngageSDKMessaging : NSObject

Class responsible for Push integration

  • Singleton instance

    Declaration

    Swift

    @objc
    public static let sharedInstance: MoEngageSDKMessaging

Push Handlers

  • Method to register for provisional push permission.

    Declaration

    Swift

    @available(iOS 12.0, *)
    @available(tvOS, unavailable)
    @objc
    public func registerForRemoteProvisionalNotification(withCategories categories: Set<UNNotificationCategory>? = nil, andUserNotificationCenterDelegate delegate: UNUserNotificationCenterDelegate? = nil)

    Parameters

    categories

    A type of notification your app supports and the custom actions that the system displays.

    delegate

    The interface for handling incoming notifications and notification-related actions.

  • Method to add the notification categories to the existing list of MOE_DISMISS_CATEGORY and MOE_PUSH_TEMPLATE category.

    Declaration

    Swift

    @available(tvOS, unavailable)
    @objc
    public func setUserNotificationCategories(_ categories: Set<UNNotificationCategory>? = nil)

    Parameters

    categories

    Set of categories.

Delegate setup

Badge reset

  • Method to disable badge reset by SDK

    Declaration

    Swift

    @available(tvOS, unavailable)
    @objc
    public func disableBadgeReset(_ disable: Bool)

    Parameters

    disable

    Pass true to disable badge reset

Push Handled by Application

  • Track notification received impression

    Declaration

    Swift

    @available(tvOS, unavailable)
    @objc
    public func logNotificationReceived(withPayload payload: [AnyHashable : Any])

    Parameters

    payload

    APNS notification payload

  • Validate if the notification belongs to MoEngage

    Declaration

    Swift

    @available(tvOS, unavailable)
    @objc
    public func isPushFromMoEngage(withPayload payload: [AnyHashable : Any]) -> Bool

    Parameters

    payload

    APNS notification payload

    Return Value

    true if notification belongs to MoEngage else false.