cdp / com.salesforce.marketingcloud.cdp / CdpSdk

CdpSdk

class CdpSdk : CoreModule, CdpAuthenticatorListener

Main CDP SDK class

Properties

consent

Property holds the last known value for consumer consent. Default is Consent.PENDING on first launch and until manually set by your application.

var consent: Consent

state

The state of the SDK.

val state: JSONObject

Functions

onTenantDeprovisioned

fun onTenantDeprovisioned(): Unit

setLocation

Sets Location tracking for given coordinates with expiration time.

fun setLocation(coordinates: Coordinates?, expiresIn: Long): Unit

track

Track an Event

fun track(event: Event?): Unit

Companion Object Functions

configure

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

fun configure(config: CdpConfig, initializationListener: InitializationListener? = null): Unit

logLevel

Set the log level and listener

fun logLevel(logLevel: LogLevel, logListener: LogListener?): Unit

requestSdk

An asynchronous request for a instance of CdpSdk.

fun requestSdk(listener: CdpReadyListener): Unit

unregisterWhenReadyListener

Prevents a CdpReadyListener from returning an instance of CdpSdk.

fun unregisterWhenReadyListener(listener: CdpReadyListener?): Unit