Edit in GitHubLog an issue

API Reference

extensionVersion

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

Java

Syntax

Copied to your clipboard
public static String extensionVersion();

Example

Copied to your clipboard
String extensionVersion = Consent.extensionVersion();

Kotlin

Example

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

getConsents

Retrieves the current consent preferences stored in the Consent extension.

Java

Syntax

Copied to your clipboard
public static void getConsents(final AdobeCallback<Map<String, Object>> callback);
  • callback - callback invoked with the current consents of the extension. If an AdobeCallbackWithError is provided, an AdobeError, can be returned in the eventuality of any error that occurred while getting the user consents. The callback may be invoked on a different thread.

Example

Copied to your clipboard
Consent.getConsents(new AdobeCallback<Map<String, Object>>() {
@Override
public void call(Map<String, Object> currentConsents) {
// Handle currentConsents
}
});

Kotlin

Example

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

registerExtension

Java

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.

Java

Syntax

Copied to your clipboard
public static void update(final Map<String, Object> consents);

Example

Copied to your clipboard
// Example 1, updating users collect consent to 'yes'
final Map<String, Object> collectConsents = new HashMap<>();
collectConsents.put("collect", new HashMap<String, String>() {
{
put("val", "y");
}
});
final Map<String, Object> consents = new HashMap<>();
consents.put("consents", collectConsents);
Consent.update(consents);
// Example 2, updating users collect consent to 'no'
final Map<String, Object> collectConsents = new HashMap<>();
collectConsents.put("collect", new HashMap<String, String>() {
{
put("val", "n");
}
});
final Map<String, Object> consents = new HashMap<>();
consents.put("consents", collectConsents);
Consent.update(consents);

Kotlin

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 © 2024 Adobe. All rights reserved.