ExperienceSdkBase

Functions

Link copied to clipboard
abstract fun addCustomProperty(key: String, value: Boolean)

Adds a custom boolean property to the custom property map of all subsequent events.

abstract fun addCustomProperty(key: String, value: Number)

Adds a custom number property to the custom property map of all subsequent events.

abstract fun addCustomProperty(key: String, value: String)

Adds a custom string property to the custom property map of all subsequent events.

Link copied to clipboard
abstract suspend fun deleteSourceData()

Deletes all data from the device storage corresponding to the current source ID, and initiates the removal of all such data from the Experience Platform servers.

Link copied to clipboard
abstract fun setSourceAttribute(key: String, value: Boolean, elapsedMillis: Long? = null)

Sends a custom boolean property for the given SDK installation (source).

abstract fun setSourceAttribute(key: String, value: Number, elapsedMillis: Long? = null)

Sends a custom number property for the given SDK installation (source).

abstract fun setSourceAttribute(key: String, value: String, elapsedMillis: Long? = null)

Sends a custom string property for the given SDK installation (source).

Link copied to clipboard
abstract suspend fun start()

Starts or resumes the event collection (measurement).

Link copied to clipboard
abstract suspend fun stop()

Stops the event collection (measurement).

Link copied to clipboard
abstract fun track(event: SendableEvent<*>)
abstract fun <T : Any> track(args: T, type: String = args::class.simpleName.orEmpty(), elapsedMillis: Long? = null)

Adds a custom event to the series of collected events.

Properties

Link copied to clipboard
abstract val events: Flow<Event>

This Flow emits all the events that are generated/created by the ExperienceSDK and also those that are added externally by the host application with the track() method.

Link copied to clipboard

Represents whether the SDK can use metered (paid) networks for sending event data to the backend. Set this to false to restrict event sending to Wi-Fi networks only.

Link copied to clipboard
abstract val sdkState: Flow<SdkState>

This Flow emits the state of the ExperienceSDK. You can use it e.g. to update the UI of the application if you want to allow the user to start or stop measurement.

Link copied to clipboard
abstract val sourceId: Flow<String>

The Source ID is the identifier of the user of the host application. It is generated on the client side by the ExperienceSDK after the first initialization. The Source ID remains the same even if the app process is restarted until the source data is deleted. When the source data is deleted, the SDK generates a new Source ID.

Link copied to clipboard
abstract val warning: Flow<ExperienceSdkException>

This Flow emits any warnings that occur asynchronously during the lifetime of the SDK. These are exceptions that do not affect the client side functionality of the SDK.