Edit in GitHubLog an issue

Syntax

Copied to your clipboard
public static String extensionVersion();

Example

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

Syntax

Copied to your clipboard
fun extensionVersion(): String

Example

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

Syntax

Copied to your clipboard
static var extensionVersion: String

Example

Copied to your clipboard
let extensionVersion = Consent.extensionVersion

Syntax

Copied to your clipboard
+ (nonnull NSString*) extensionVersion;

Example

Copied to your clipboard
NSString *extensionVersion = [AEPMobileEdgeConsent extensionVersion];

Syntax

Copied to your clipboard
public static void getConsents(final AdobeCallback<Map<String, Object>> callback);
  • 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(new AdobeCallback<Map<String, Object>>() {
@Override
public void call(Map<String, Object> currentConsents) {
// Handle currentConsents
}
});

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
}

Syntax

Copied to your clipboard
static func getConsents(completion: @escaping ([String: Any]?, Error?) -> Void)
  • completion - Invoked with the current consent preferences or an AEPError if an error occurs or the request times out. The completion may be invoked on a different thread.

Example

Copied to your clipboard
Consent.getConsents { currentConsents, error in
// Handle currentConsents
}

Syntax

Copied to your clipboard
+ (void) getConsents:^ (NSDictionary<NSString *,id> * _Nullable, NSError * _Nullable)
  • completion - Invoked with the current consent preferences or an AEPError if an error occurs or the request times out. The completion may be invoked on a different thread.

Example

Copied to your clipboard
[AEPMobileEdgeConsent getConsents:^(NSDictionary *currentConsents, NSError *error){
// Handle currentConsents
}];

Syntax

Copied to your clipboard
public static void registerExtension();

Example

Copied to your clipboard
Consent.registerExtension();

Use the MobileCore API to register the Edge Consent extension.

Syntax

Copied to your clipboard
static func registerExtensions(_ extensions: [NSObject.Type],
_ completion: (() -> Void)? = nil)

Example

Copied to your clipboard
import AEPEdgeConsent
...
MobileCore.registerExtensions([Consent.self])

Use the AEPMobileCore API to register the Edge Consent extension.

Syntax

Copied to your clipboard
+ (void) registerExtensions: (NSArray<Class*>* _Nonnull) extensions
completion: (void (^ _Nullable)(void)) completion;

Example

Copied to your clipboard
@import AEPEdgeConsent;
...
[AEPMobileCore registerExtensions:@[AEPMobileEdgeConsent.class] completion:nil];

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);

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)

Syntax

Copied to your clipboard
static func update(with consents: [String: Any])

Example

Copied to your clipboard
// Example 1, updating users collect consent to 'yes'
let collectConsent = ["collect": ["val": "y"]]
let currentConsents = ["consents": collectConsent]
Consent.update(with: currentConsents)
// Example 2, updating users collect consent to 'no'
let collectConsent = ["collect": ["val": "n"]]
let currentConsents = ["consents": collectConsent]
Consent.update(with: currentConsents)

Syntax

Copied to your clipboard
+ (void) updateWithConsents:(NSDictionary<NSString *,id> * _Nonnull)

Example

Copied to your clipboard
// Example 1, updating users collect consent to 'yes'
NSDictionary *collectConsent = @{ @"collect": @{@"val": @"y"};
[AEPMobileEdgeConsent updateWithConsents:@{@"consents": collectConsent}];
// Example 2, updating users collect consent to 'no'
NSDictionary *collectConsent = @{ @"collect": @{@"val": @"n"};
[AEPMobileEdgeConsent updateWithConsents:@{@"consents": collectConsent}];
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.