sfmcsdk / com.salesforce.marketingcloud.sfmcsdk / SFMCSdk

SFMCSdk

class SFMCSdk

The SFMCSdk is a shared-services SDK intended to empower other libraries by providing ready-made implementations for commonly used services: http communications, encryption, local storage, etc.

Properties

config

val config: SFMCSdkModuleConfig

identity

One Instance variable of identity used across modules Module to set profile information . Initialised when SFMCSdk is configured via SFMCSdk.configure.

lateinit var identity: Identity

Functions

cdp

An asynchronous request for a instance of CdpModuleInterface.

fun cdp(listener: CdpModuleReadyListener): Unit

getSdkState

Return the current state of all SDK modules

fun getSdkState(): JSONObject

mp

An asynchronous request for a instance of PushModuleInterface.

fun mp(listener: PushModuleReadyListener): Unit

Companion Object Functions

configure

Initializes the SDK with the provided SFMCSdkModuleConfig. Once complete, the InitializationListener will be notified. Any subsequent calls to this method will be ignored as long as the values provided in SFMCSdkModuleConfig are the same. Note: Anyone that calls requestSdk before or during the initialization will be notified before the InitializationListener will be notified.

fun configure(context: Context, config: SFMCSdkModuleConfig, listener: InitializationListener? = null): Unit

requestSdk

An asynchronous request for a instance of SFMCSdk.

fun requestSdk(listener: SFMCSdkReadyListener): Unit

setLogging

Enable/Disable Logging in the SFMCSdk.

fun setLogging(level: LogLevel, listener: LogListener?): Unit

track

fun track(vararg events: Event?): Unit