Syntax
Copied to your clipboardpublic static String extensionVersion();
Example
Copied to your clipboardString extensionVersion = Consent.extensionVersion();
Syntax
Copied to your clipboardfun extensionVersion(): String
Example
Copied to your clipboardval extensionVersion = Consent.extensionVersion()
Syntax
Copied to your clipboardstatic var extensionVersion: String
Example
Copied to your clipboardlet extensionVersion = Consent.extensionVersion
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *extensionVersion = [AEPMobileEdgeConsent extensionVersion];
Syntax
Copied to your clipboardpublic static void getConsents(final AdobeCallback<Map<String, Object>> callback);
- callback - Invoked with the current consent preferences. If an
AdobeCallbackWithError
is provided, anAdobeError
is returned if any error occurs while retrieving the user consents. The callback may be invoked on a different thread.
Example
Copied to your clipboardConsent.getConsents(new AdobeCallback<Map<String, Object>>() {@Overridepublic void call(Map<String, Object> currentConsents) {// Handle currentConsents}});
Syntax
Copied to your clipboardfun getConsents(callback: AdobeCallback<Map<String, Any>>)
- callback - Invoked with the current consent preferences. If an
AdobeCallbackWithError
is provided, anAdobeError
is returned if any error occurs while retrieving the user consents. The callback may be invoked on a different thread.
Example
Copied to your clipboardConsent.getConsents { currentConsents ->// Handle currentConsents}
Syntax
Copied to your clipboardstatic 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 clipboardConsent.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 clipboardpublic static void registerExtension();
Example
Copied to your clipboardConsent.registerExtension();
Use the MobileCore API to register the Edge Consent extension.
Syntax
Copied to your clipboardstatic func registerExtensions(_ extensions: [NSObject.Type],_ completion: (() -> Void)? = nil)
Example
Copied to your clipboardimport 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) extensionscompletion: (void (^ _Nullable)(void)) completion;
Example
Copied to your clipboard@import AEPEdgeConsent;...[AEPMobileCore registerExtensions:@[AEPMobileEdgeConsent.class] completion:nil];
Syntax
Copied to your clipboardpublic static void update(final Map<String, Object> consents);
- consents - A
Map
of consents defined based on Privacy/Personalization/Marketing Preferences (Consents) XDM Schema.
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 clipboardfun update(consents: Map<String, Any>)
- consents - A
Map
of consents defined based on Privacy/Personalization/Marketing Preferences (Consents) XDM Schema.
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"] = collectConsentsConsent.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"] = collectConsentsConsent.update(consents)
Syntax
Copied to your clipboardstatic func update(with consents: [String: Any])
- consents - A
[String: Any]
of consents defined based on Privacy/Personalization/Marketing Preferences (Consents) XDM Schema.
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)
- consents - A
[String: Any]
of consents defined based on Privacy/Personalization/Marketing Preferences (Consents) XDM Schema.
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}];