MobileAppMessaging

@objc(SFMobileAppMessaging)
public final class MobileAppMessaging : NSObject, SFMCModule, Publisher
extension MobileAppMessaging: Subscriber
extension MobileAppMessaging: MobileAppMessagingApi
extension MobileAppMessaging: MobileAppMessagingProtocol

This class is a Swift Interface for SFMobileAppMessaging

Request SDK Method

  • Requests the MobileAppMessaging Module when it’s operational and safe to use. The provided callback will be invoked with the MobileAppMessaging Module when it’s ready. All MobileAppMessaging module-related API calls should be made within this function.

    Declaration

    Swift

    @objc
    public static func requestSdk(_ callback: @escaping (_ mamCore: MobileAppMessagingApi?) -> Void)

    Parameters

    callback

    A callback that will receive the MobileAppMessaging Module when it’s operational/ready.

Registration Methods

  • Register a callback that will be notified when Registration related events happen

    @param registrationCallback closure to be provided when registration event occurs

    Declaration

    Swift

    public func setRegistrationCallback(_ registrationCallback: @escaping (Dictionary<AnyHashable, Any>) -> Void)
  • Removes the registration callback

    Declaration

    Swift

    public func unsetRegistrationCallback()
  • Returns the unique identifier associated with the device.

    Declaration

    Swift

    public func deviceIdentifier() -> String?

    Return Value

    A String representing the device identifier, or nil if unavailable.

Feature Toggle Methods

  • Developer override to set the state of analytics enablement. If set false, the SDK will stop tracking analytics and also purges all the analytics stored locally. This value takes precedence over the config setting which is passed during the SDK initialization.

    Declaration

    Swift

    public func setAnalyticsEnabled(_ enabled: Bool)
  • The current state of the Analytics enablement override

    Declaration

    Swift

    public func isAnalyticsEnabled() -> Bool

    Return Value

    A BOOL value of the Analytics enablement override considering config setting .