AATKit Android Integration
Release Notes
  • Start
    • Setup
      • Maven
      • Prerequisites
      • Google Family Safe Apps
    • Initialization
    • Consent
      • General Handling
      • Managed Consent
        • Google CMP
        • Sourcepoint CMP
        • SFBX (AppConsent) CMP
      • Vendor Consent
      • Simple Consent
    • Plugins documentation
    • Additional Information
  • Formats
    • Introduction
    • Banner
      • Auto Load Banner
      • Multi-Size Auto Load Banner
      • Banner Cache
      • Infeed Banner
      • Sticky Banner
      • Multi-Size Banner
    • Fullscreen (Interstitial)
    • AppOpen (Google)
    • Rewarded Video
      • Server-Side Verification (SSV)
    • Native Ad
      • Basic Integration
      • Network Specifics
        • Native Ads: Google
        • Native Ads: ApplovinMax
        • Native Ads: Bluestack
        • Native Ads: FacebookAudienceNetwork
        • Native Ads: Huawei
  • Ad Networks
    • Customize Ad Networks
    • Google Mobile Ads SDK
    • AppLovinMax Ad Review
    • AppNexus special settings
    • FeedAd Shutter Colour and Disabling Spinner
    • Kidoz
  • Advanced
    • Targeting
      • Key-Value Targeting
      • User Targeting
      • Content Targeting URL
    • Frequency Capping
    • Advanced Listeners
      • Reports Delegate
      • Impression Listener (ILRD)
      • Statistics Listener
    • AATKit's Size
    • Ad Space and Fill Rate
    • Shake Debug
    • Child-directed Support
    • Geo Tracking
    • Disabling Ad Networks
    • Huawei Support
    • Creatives History
  • Other
    • AdMob Custom Events
    • Reference
      • Classes
        • AATKit
        • AATKitUserTargeting
        • CollapsibleBannerOptions
        • AATKitDebugScreenConfiguration
        • PlacementDebugInfo
        • AATKitDebugInfo
        • AATKitConfiguration
        • AATKitRuntimeConfiguration
        • ManagedConsent
        • VendorConsent
        • SimpleConsent
        • BannerConfiguration
        • BannerRequest
        • BannerCacheConfiguration
        • AATKitReward
        • NativeAdRating
        • AATKitImpression
        • PriceInfo
        • AdInfo
        • RewardedAdSSVInfo
        • PlacementHistoryInfo
        • AATKitAdNetworkOptions
          • SuperAwesomeOptions
          • FeedAdOptions
          • AppNexusOptions
          • AdMobOptions
          • DFPOptions
      • Interfaces
        • CacheStatusDelegate
        • AATKit.Delegate
        • BannerCache
        • BannerRequestCompletionListener
        • ManagedConsentDelegate
        • VendorConsentDelegate
        • Placement
        • StickyBannerPlacement
        • StickyBannerPlacementListener
        • MultiSizeBannerPlacement
        • MultiSizeBannerPlacementListener
        • InfeedBannerPlacement
        • InfeedBannerPlacementListener
        • BannerRequestDelegate
        • CacheDelegate
        • FullscreenPlacement
        • FullscreenPlacementListener
        • AppOpenAdPlacement
        • AppOpenPlacementListener
        • RewardedVideoPlacement
        • RewardedVideoPlacementListener
        • NativeAdPlacement
        • NativePlacementListener
        • NativeAdData
        • AutoLoadBannerPlacement
        • AutoLoadBannerPlacementListener
        • AutoLoadMultiSizeBannerPlacement
        • AutoLoadMultiSizeBannerPlacementListener
        • ReportsDelegate
        • ImpressionListener
        • StatisticsListener
      • Enumerations
        • AATKitGender
        • AdNetwork
        • ManagedConsentState
        • NonIABConsent
        • BannerPlacementSize
        • BannerSize
        • MediationType
        • ImpressionPricePrecisionType
  • Samples
Powered by GitBook
On this page
  • Introduction
  • Managed Consent States
  • Re-asking for consent if rejected
  • Consent Opt-in Status
  • Code Examples
  1. Start
  2. Consent

Managed Consent

Handle consent using AATKit managed consent

Last updated 2 months ago

Introduction

AATKit’s Managed Consent is an easy way to facilitate compliant third-party (CMPs) by providing a unified API and wrappers. In order to make use of Managed Consent, pass an instance of AATManagedConsent to your AATConfiguration instance while initializing AATKit.

An instance must be initialized with:

  • cmp: An instance of CMP interface. Currently, supported implementations are CMPGoogle (), CMPSourcepoint (), and CMPAppConsent ()

  • context: An Context instance (Activity, Application)

  • delegate: An instance of an object that implements interface.

Also, the app needs to trigger the presentation of the CMP by calling showIfNeeded. The CMP will only appear if user consent wasn’t asked for recently or is outdated.

AATKitConfiguration configuration = new AATKitConfiguration(this);
configuration.setDelegate(this);
CMP cmp = <INSTANCE OF CMPGoogle or CMPSourcepoint or CMPAppConsent>;
ManagedConsent managedConsent = new ManagedConsent(cmp, this, this, ManagedConsent.ShowIfNeededSetting.ALWAYS);
configuration.setConsent(managedConsent);
AATKit.init(configuration);
...
managedConsent.showIfNeeded(<ActivityInstance>);
val configuration = AATKitConfiguration(this)
configuration.delegate = this
val cmp: CMP = <INSTANCE OF CMPGoogle or CMPSourcepoint or CMPAppConsent>
val managedConsent = ManagedConsent(cmp, this, this, ManagedConsent.ShowIfNeededSetting.ALWAYS)
configuration.consent = managedConsent
AATKit.init(configuration)

managedConsent.showIfNeeded(<ActivityInstance>)

Added to this, your app must provide a way for the user to edit once given consent settings, e.g. by providing a button in the app’s “Privacy Settings”. This button must trigger editConsent.

Also, your instance of the respective CMP used must be set up at its respective backend/dashboard. Please refer to your CMP’s documentation or contact our support.

Managed Consent States

Re-asking for consent if rejected

If you would like to periodically re-ask users that rejected consent, you can use method showIfNeededOrRejected(daysAgo: Int, activity: Activity) instead of showIfNeeded. In addition to normal showIfNeeded behaviour, it will check consent state and timestamp of last consent string update. If the consent is rejected and last update happened more than daysAgo, consent dialog will be shown again.

Consent Opt-in Status

To set Consent opt-in status, you need to pass showIfNeededSetting to ManagedConsent while initializing.

  • showIfNeededSetting can be one of the following:

    • ALWAYS: always show the CMP.

    • NEVER: never show the CMP, However, the publisher can still call the editConsent API.

    • SERVER_SIDE_CONTROL: showing the CMP will be based on the dashboard configurations.

  • It has a default value of: SERVER_SIDE_CONTROL.

Code Examples

When the user finishes his consent choice, you can check the consent status via the 's method: managedConsentCMPFinished(state: ManagedConsentState) where is an enum with the available (non-IAB) consent states. This shall facilitate a more easy understanding of the complex IAB consent string and is only used for internal purposes (e.g. reporting).

To check the server-side consent opt-in status call AATKit.isConsentOptIn(), which only returns meaningful information after AATKit was successfully initialized (and did download its mediation rules from the backend (If you want to observe this, see )).

.

IAB TCF
Consent Management Platforms
ManagedConsent
Google CMP
Sourcepoint CMP
SFBX (AppConsent) CMP
ManagedConsentDelegate
ManagedConsentDelegate
ManagedConsentState
AATKit.Delegate
Example using Sourcepoint CMP.
Example using SFBX (AppConsent) CMP.
Example using Google CMP