Class Consent


  • public class Consent
    extends Object
    • Field Detail

      • EXTENSION

        public static final Class<? extends com.adobe.marketing.mobile.Extension> EXTENSION
    • Method Detail

      • extensionVersion

        @NonNull
        public static String extensionVersion()
        Returns the version of the Consent extension
        Returns:
        The version as String
      • registerExtension

        @Deprecated
        public static void registerExtension()
        Deprecated.
        Use MobileCore.registerExtensions(List, AdobeCallback) with EXTENSION instead.
        Registers the extension with the Mobile SDK. This method should be called only once in your application class.
      • update

        public static void update​(@NonNull
                                  Map<String,​Object> consents)
        Merges the existing consents with the given consents. Duplicate keys will take the value of those passed in the API

        Input example: {"consents": {"collect": {"val": "y"}}}

        Parameters:
        consents - A Map of consents to be merged with the existing consents
      • getConsents

        public static void getConsents​(@NonNull
                                       com.adobe.marketing.mobile.AdobeCallback<Map<String,​Object>> callback)
        Retrieves the current consent preferences stored in the Consent extension

        Output example: {"consents": {"collect": {"val": "y"}}}

        Parameters:
        callback - The AdobeCallback is invoked with the current consent preferences. If an AdobeCallbackWithError is provided, an AdobeError is returned when an unexpected error occurs or the request timed out