fetchExperience

fun fetchExperience(context: Context, experienceKey: String, attributes: Map<String, String> = emptyMap(), onSuccess: SuccessCallback<ExperienceCampaignsResult>, onFailure: (reason: RequestFailureReasonCode, message: String) -> Unit, workspaceId: String? = null)

Fetches a personalized experience campaign.

Since

1.0.0

Parameters

context

An instance of Context.

experienceKey

The key of the experience to fetch.

attributes

Optional attributes to filter the experience.

onSuccess

A callback invoked with the fetched experience campaign on success. This callback is always invoked on the main thread

onFailure

A callback invoked with the reason and message on failure. This callback is always invoked on the main thread

workspaceId

The optional workspace ID; if null, the default instance will be used.

Throws

if the SDK is not initialized for the given instance.