SFMCSdk

@objc(SFMCSdk)
public final class SFMCSdk : NSObject

SFMCSDK Module Properties

  • cdp

    Declaration

    Swift

    @objc
    public static var cdp: CDP
  • mp

    Declaration

    Swift

    @objc
    public static var mp: PUSH
  • Declaration

    Swift

    @objc
    public static var personalization: PERSONALIZATION
  • Declaration

    Swift

    @objc
    public static var identity: IDENTITY
  • Declaration

    Swift

    @objc
    public static var sdkVersion: String

SFMCSDK Methods

  • Declaration

    Swift

    @objc
    public static func initializeSdk(_ configuration: Config)
  • Declaration

    Swift

    @objc
    public static func track(event: Event)
  • Declaration

    Swift

    @objc
    public static func state() -> String

Logger Methods

DataMerge Methods

Keychain Helpers

  • Provides a way to set/override the accessibility attribute for Keychain

    Declaration

    Swift

    @available(*, deprecated, message: "This method is obsolete and has been deprecated")
    @objc
    public static func setKeychainAccessibleAttribute(accessibleAttribute: CFTypeRef?)

    Parameters

    accessibleAttribute

    CFTypeRef which has any one of below values kSecAttrAccessibleWhenUnlocked kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly kSecAttrAccessibleWhenUnlockedThisDeviceOnly kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly kSecAttrAccessibleAlwaysThisDeviceOnly

  • Returns accessible attribute set by the SDK or overridden value by the consuming application

    Declaration

    Swift

    @available(*, deprecated, message: "This method is obsolete and has been deprecated")
    @objc
    public static func keychainAccessibleAttribute() -> CFTypeRef?
  • Sets whether or not keychain access errors cause a fatal exception.

    Declaration

    Swift

    @available(*, deprecated, message: "This method has no effect, SFMCSdk does not throw fatal exceptions anymore")
    @objc
    public static func setKeychainAccessErrorsAreFatal(errorsAreFatal: Bool)
  • Declaration

    Swift

    @available(*, deprecated, message: "This method has no effect, SFMCSdk does not throw fatal exceptions anymore")
    @objc
    public static func keychainAccessErrorsAreFatal() -> Bool

File Protection Helpers

  • Provides a way to set/override the Protection level for File system

    Declaration

    Swift

    @objc
    public static func setFileProtectionType(fileProtectionType: FileProtectionType?)

    Parameters

    fileProtectionType

    FileProtectionType which has any one of the below values NSFileProtectionComplete NSFileProtectionCompleteUnlessOpen NSFileProtectionCompleteUntilFirstUserAuthentication NSFileProtectionNone

  • Returns File protection type set by the SDK or overridden value by the consuming application

    Declaration

    Swift

    @objc
    public static func fileProtectionType() -> FileProtectionType?
  • Requests the Mobile Push SDK when it’s operational and safe to use. The provided callback will be invoked with the Mobile Push SDK when it’s ready. All push SDK-related API calls should be made within this function.

    Declaration

    Swift

    @objc
    public static func requestPushSdk(_ callback: @escaping (_ mp: PushInterface) -> Void)

    Parameters

    callback

    A callback that will receive the Mobile Push SDK when it’s operational/ready.

  • Requests the Personalization Module/SDK when it’s operational and safe to use. The provided callback will be invoked when Personalization is ready. The host app shouldn’t normally need to use this, as the Personalization module itself already does this for async operations, like fetching decisions/personalization. As Personalization intentionally doesn’t expose much functionality to the base SFMCSdk, one could use PersonalizationModule.shared within the callback code to use module-specific functionality.

    Declaration

    Swift

    @objc
    public static func requestPersonalizationSdk(_ callback: @escaping () -> Void)

    Parameters

    callback

    The callback/task to run when Personalization is ready.

  • Requests the CDP Module/SDK when it’s operational and safe to use. The provided callback will be invoked when CDP Is ready.

    Declaration

    Swift

    @objc
    public static func requestCdpSdk(_ callback: @escaping (_ cdp: CdpInterface) -> Void)

    Parameters

    callback

    The callback/task to run when CDP is ready.