SFMCSdk
@objc(SFMCSdk)
public final class SFMCSdk : NSObject
-
Declaration
Swift
@objc public static var cdp: CDP -
Declaration
Swift
@objc public static var personalization: PERSONALIZATION -
Declaration
Swift
@objc public static let identity: Identity
-
Declaration
Swift
@objc public static func initializeSdk(_ configuration: Config, completion: ((_ status: [ModuleInitStatus]) -> Void)? = nil) -
Declaration
Swift
@objc public static func state() -> String
-
Declaration
Swift
@objc public static func setLogger(logLevel: LogLevel, logOutputter: LogOutputter? = LogOutputter()) -
Declaration
Swift
public static func setLogger(logLevel: LogLevel, logOutputter: LogOutputter? = LogOutputter(), filters: [LoggerCategory] = [LoggerCategory]()) -
Declaration
Swift
@objc public static func getLogLevel() -> LogLevel -
Declaration
Swift
@objc public static func clearLoggerFilters()
-
Provides a way to set/override the Protection level for File system
Declaration
Swift
@objc public static func setFileProtectionType(fileProtectionType: FileProtectionType?)Parameters
fileProtectionTypeFileProtectionType 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 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.sharedwithin the callback code to use module-specific functionality.Declaration
Swift
@objc public static func requestPersonalizationSdk(_ callback: @escaping () -> Void)Parameters
callbackThe 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
callbackThe callback/task to run when CDP is ready.
-
Tracks a custom event which are dispatched to all registered SDK modules.
Events are processed asynchronously and may be batched before being sent to the network.
Use [sendImmediate] for time-sensitive events that should bypass normal queuing.
Declaration
Swift
@objc public static func track(event: Event)Parameters
eventcustom event to track
-
Tracks a custom event at high priority and schedules it to be sent to the server along with any other pending events in the queue. Unlike [track], this attempts to deliver queued events promptly rather than waiting for the next scheduled interval.
This API is subject to SDK guardrails — there is a 60-second throttling period between consecutive calls. Use it only when timely delivery is important.
Declaration
Swift
@objc public static func sendImmediate(event: Event)Parameters
eventcustom event to track at high priority
-
Schedules a flush of any queued events. The flush is subject to SDK guardrails — notably, a 60-second throttling period between consecutive flush calls. If a flush was recently performed, the request will be deferred until the throttle window has elapsed.
Use this only when prompt delivery is critical.
Calling it frequently will not accelerate delivery and may be throttled by the SDK.
Declaration
Swift
@objc public static func flush()
SFMCSdk Class Reference