MoEngageBadgeHandler

@available(tvOS, unavailable)
public enum MoEngageBadgeHandler

Owns all badge-count logic for the MoEngage SDK. : nodoc:

Configuration

  • Whether the SDK should manage badge counts. Reads MoEngageBadgeUpdateEnabled from the main app’s Info.plist; defaults to true.

    Declaration

    Swift

    public static var isBadgeUpdateEnabled: Bool { get }

Main app

  • Sets the app icon badge to the count of MoEngage badge-eligible notifications currently in the Notification Center. No-op when MoEngageBadgeUpdateEnabled is false.

    Call on: app launch, app foreground, any notification interaction.

    Declaration

    Swift

    public static func updateBadgeInMainApp()

Notification Service Extension

  • Returns the badge value to stamp on an incoming notification’s content, for use in a Notification Service Extension.

    Declaration

    Swift

    public static func badgeForIncomingNotification(
        deliveredNotifications: [UNNotification]
    ) -> NSNumber

    Parameters

    deliveredNotifications

    The already-delivered notifications obtained from UNUserNotificationCenter.getDeliveredNotifications.

    Return Value

    The new badge count (delivered eligible + 1)