Edit in GitHubLog an issue

Java

You can set the collect consent to one of the following values:

  • y
  • n

To understand the expected behavior, see the Update and get collect consent preferences table above.

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 occured 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) {
if (currentConsents == null) { return; }
final Map<String, Object> consents = currentConsets.get("consents");
final Map<String, Object> collectConsent = consents.get("collect");
final String collectConsentStatus = collectConsent.get("val");
// inspect collectConsentStatus
}
});

You can set the privacy status to one of the following values:

  • MobilePrivacyStatus.OPT_IN
  • MobilePrivacyStatus.OPT_OUT
  • MobilePrivacyStatus.UNKNOWN

To understand the expected behavior, see the "Set and get privacy status" table above.

Java

Syntax

Copied to your clipboard
public static void setPrivacyStatus(final MobilePrivacyStatus privacyStatus);

Example

Copied to your clipboard
MobileCore.setPrivacyStatus(MobilePrivacyStatus.OPT_OUT);

You can set privacy status to one of the following values:

  • ACPMobilePrivacyStatusOptIn
  • ACPMobilePrivacyStatusOptOut
  • ACPMobilePrivacyStatusUnknown

To understand the expected behavior, see the Set and get privacy status table above.

Swift

Syntax

Copied to your clipboard
class func setPrivacyStatus(_ status: ACPMobilePrivacyStatus) {
}

Example

Copied to your clipboard
ACPCore.privacyStatus = ACPMobilePrivacyStatusOptIn

Objective-C

Syntax

Copied to your clipboard
+ (void) setPrivacyStatus: (ACPMobilePrivacyStatus) status;

Example

Copied to your clipboard
[ACPCore setPrivacyStatus:ACPMobilePrivacyStatusOptIn];

The enum representation of the privacy status that corresponds to the following statuses:

  • MobilePrivacyStatus.OPT_IN
  • MobilePrivacyStatus.OPT_OUT
  • MobilePrivacyStatus.UNKNOWN

Java

Syntax

Copied to your clipboard
void getPrivacyStatus(AdobeCallback<MobilePrivacyStatus> callback);
  • callback is invoked after the privacy status is available.
  • If an instance of AdobeCallbackWithError is provided, and you are fetching the attributes from the Mobile SDK, the timeout value is 5000ms. If the operation times out or an unexpected error occurs, the fail method is called with the appropriate AdobeError.

Example

Copied to your clipboard
MobileCore.getPrivacyStatus(new AdobeCallback<MobilePrivacyStatus>() {
@Override
public void call(MobilePrivacyStatus value) {
System.out.println("getPrivacyStatus: " + status);
}
});

The enum representation of the privacy status that corresponds to the following statuses:

  • ACPMobilePrivacyStatusOptIn
  • ACPMobilePrivacyStatusOptOut
  • ACPMobilePrivacyStatusUnknown

Swift

Syntax

Copied to your clipboard
class func getPrivacyStatus(_ callback: @escaping (_ status: ACPMobilePrivacyStatus) -> Void)
class func getPrivacyStatus(withCompletionHandler completionHandler: @escaping (_ status: ACPMobilePrivacyStatus, _ error: Error?) -> Void)
  • callback is invoked after the privacy status is available.
  • completionHandler is invoked with the current privacy status, or error if an unexpected error occurs or the request times out. The default timeout is 5000ms.

Example

Copied to your clipboard
ACPCore.getPrivacyStatus(
{ status in
switch status {
case ACPMobilePrivacyStatusOptIn:
print("Privacy Status: Opt-In")
default:
break
}
})
ACPCore.getPrivacyStatus(withCompletionHandler: { status, error in
if error != nil {
// handle error here
} else {
// handle the retrieved privacy status
}
})

Objective-C

Syntax

Copied to your clipboard
+ (void) getPrivacyStatus: (nonnull void (^) (ACPMobilePrivacyStatus status)) callback;
+ (void) getPrivacyStatusWithCompletionHandler: (nonnull void (^) (ACPMobilePrivacyStatus status, NSError* _Nullable error)) completionHandler;
  • callback is invoked after the privacy status is available.
  • completionHandler is invoked with the current privacy status, or error if an unexpected error occurs or the request times out. The default timeout is 5000ms.

Example

Copied to your clipboard
[ACPCore
getPrivacyStatus:^(ACPMobilePrivacyStatus status) {
switch (status) {
case ACPMobilePrivacyStatusOptIn: NSLog(@"Privacy Status: Opt-In"); break;
}
}];
[ACPCore getPrivacyStatusWithCompletionHandler:^(ACPMobilePrivacyStatus status, NSError * _Nullable error) {
if (error) {
// handle error here
} else {
// handle the retrieved privacy status
}
}];
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.