This API is created for Usercentrics Partners
If you are considering consuming these APIs, make sure that your use case truly requires it. In case of any doubt, don't hesitate to talk to our support team.
Consent Listener
onConsentUpdated
Disposable event that send the updated consent as a game object named UpdatedConsentPayload. This event is emitted when consent is updated.
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
Method for disposing event callback for the consent listener.
let disposableEvent = UsercentricsEvent.shared.onConsentUpdated(callback: ...)
disposableEvent.dispose()val disposableEvent = UsercentricsEvent.onConsentUpdated(callback = ...)
disposableEvent.dispose()Objects
UpdatedConsentPayload
Contains user consent information.
Property | Type | Notes |
|---|---|---|
consents | List of Services with consent choices. | |
controllerId | String | A Usercentrics generated ID, used to identify a specific user. See Restore User Session |
tcString | 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
The current consent status of a specific service.
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. |
Mediation Listener
onConsentMediation
Disposable event that send the updated consent as a game object named MediationResultPayload. This event is emitted when consent mediation is aplied.
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
Method for disposing event callback for the mediation listener.
let disposableEvent = UsercentricsEvent.onConsentMediation(callback: ...)
disposableEvent.dispose()val disposableEvent = UsercentricsEvent.onConsentMediation(callback: ...)
disposableEvent.dispose()Objects
MediationResultPayload
Contains list of the consents applied through consent mediation.
Property | Type | Notes |
|---|---|---|
applied | List<ConsentApplied> | List of Consent Applied payload. |
ConsentApplied
Contains information about consent applied through consent mediation.
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. |