MoEngageSDKMessaging
@objc
public class MoEngageSDKMessaging : NSObject
Class responsible for Push integration
-
Singleton instance
Declaration
Swift
@objc public static let sharedInstance: MoEngageSDKMessaging
-
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
andMOE_PUSH_TEMPLATE
category.Declaration
Swift
@available(tvOS, unavailable) @objc public func setUserNotificationCategories(_ categories: Set<UNNotificationCategory>? = nil)
Parameters
categories
Set of categories.
-
Set the delegate inorder to receive the notification related callbacks
Declaration
Swift
@available(tvOS, unavailable) @objc public func setMessagingDelegate(_ delegate: MoEngageMessagingDelegate?)
Parameters
delegate
Instance that conforms to
MoEngageMessagingDelegate
protocol. -
Set the delegate inorder to receive the notification related callbacksfor Secondary MoEngage Instance.
Declaration
Swift
@available(tvOS, unavailable) @objc public func setMessagingDelegate(_ delegate: MoEngageMessagingDelegate?, forAppID appID: String? = nil)
Parameters
delegate
Instance that conforms to
MoEngageMessagingDelegate
protocol.appID
MoEngage Account Identifier
-
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
-
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.