Skip to content

UsercentricsEvent API

This API is created for Usercentrics Partners

If you are considering to consume those APIs, make sure that your use case really need this and in case of any doubt, don't hesitate on talking to our support team.

onConsentUpdated

UsercentricsEvent.shared.onConsentUpdated(callback: <(UpdatedConsentPayload) -> Void>): UsercentricsDisposableEvent<UpdatedConsentPayload>
UsercentricsEvent.onConsentUpdated(callback: <(UpdatedConsentPayload) -> Unit>): UsercentricsDisposableEvent<UpdatedConsentPayload>
Inputs Type Notes
callback <(UpdatedConsentPayload) -> Unit> Callback with relevant information regarding consents
Output Type Notes
Disposable Event UsercentricsDisposableEvent Object with a function to dispose the callback created

dispose

let disposableEvent = UsercentricsEvent.shared.onConsentUpdated(callback: ...)
disposableEvent.dispose()
val disposableEvent = UsercentricsEvent.onConsentUpdated(callback = ...)
disposableEvent.dispose()

Objects

UpdatedConsentPayload

Property Type Notes
consents UsercentricsServiceConsent List of Services with consent choices.
controllerId String A Usercentrics generated ID, used to identify a specific user. See Restore User Session
tcString String IAB's Transparency & Consent String
uspString String IAB's US Privacy String
acString String A String that represents the consented and disclosed Google Ad Technology Providers (ATPs), as defined by Google.

UsercentricsServiceConsent

Property Type Notes
templateId String ID used to match a service with frameworks running on your app. See Applying Consent.
status Bool Consent status given to this specific service.
dataProcessor String Name of entity processing the data that was collected via this service.
version String Legal template version. See Service Settings.

Mediation Listener

onConsentMediation

UsercentricsEvent.shared.onConsentMediation(callback: <(MediationResultPayload) -> Void>): UsercentricsDisposableEvent<MediationResultPayload>
UsercentricsEvent.onConsentMediation(callback:<(MediationResultPayload) -> Unit>): UsercentricsDisposableEvent<MediationResultPayload>
Inputs Type Notes
callback (MediationResultPayload) -> Void Callback with relevant information regarding mediation
Output Type Notes
Disposable Event UsercentricsDisposableEvent Object with a function to dispose the callback created

dispose

let disposableEvent = UsercentricsEvent.onConsentMediation(callback: ...)
disposableEvent.dispose()
val disposableEvent = UsercentricsEvent.onConsentMediation(callback: ...)
disposableEvent.dispose()

Objects

MediationResultPayload

Property Type Notes
applied ConsentApplied List of Consent Applied payload.

ConsentApplied

Property Type Notes
name String Name of the SDK mediated.
templateId String Template ID that represents the SDK.
consent Bool Consent status given to this specific service.
mediated Bool Mediation success status.