Edit in GitHubLog an issue

API Reference

extensionVersion

The extensionVersion() API returns the version of the client-side Consent extension.

Syntax

Copied to your clipboard
fun extensionVersion(): String

Example

Copied to your clipboard
val extensionVersion = Consent.extensionVersion()

getConsents

Retrieves the current consent preferences stored in the Consent extension.

Syntax

Copied to your clipboard
fun getConsents(callback: AdobeCallback<Map<String, Any>>)
  • callback - Invoked with the current consent preferences. If an AdobeCallbackWithError is provided, an AdobeError is returned if any error occurs while retrieving the user consents. The callback may be invoked on a different thread.

Example

Copied to your clipboard
Consent.getConsents { currentConsents ->
// Handle currentConsents
}

registerExtension

Syntax

Copied to your clipboard
public static void registerExtension();

Example

Copied to your clipboard
Consent.registerExtension();

updateConsents

Merges the existing consents with the given consents. Duplicate keys will take the value of those passed in the API.

Syntax

Copied to your clipboard
fun update(consents: Map<String, Any>)

Example

Copied to your clipboard
// Example 1, updating users collect consent to 'yes'
val collectConsents = mutableMapOf<String, Any>()
collectConsents["collect"] = mutableMapOf("val" to "y")
val consents = mutableMapOf<String, Any>()
consents["consents"] = collectConsents
Consent.update(consents)
// Example 2, updating users collect consent to 'no'
val collectConsents = mutableMapOf<String, Any>()
collectConsents["collect"] = mutableMapOf("val" to "n")
val consents = mutableMapOf<String, Any>()
consents["consents"] = collectConsents
Consent.update(consents)

For additional information about the management of consent preferences, please refer to the Privacy and GDPR documentation.

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.