AATKit Flutter Integration
Release Notes
  • Start
    • Setup
    • Initialization
    • App Tracking Transparency
    • Google Mobile Ads SDK
    • Consent
      • Managed Consent
      • Vendor Consent
      • Simple Consent
  • Formats
    • Banner
    • Banner Cache
    • Fullscreen (Interstitial)
    • Rewarded Video
    • App Open Ad
  • Reference
Powered by GitBook
On this page
  • Introduction
  • Google CMP Usage
  • SourcePoint CMP Usage
  • SFBX/AppConsent
  1. Start
  2. Consent

Managed Consent

Handle consent using managed consent

PreviousConsentNextVendor Consent

Last updated 6 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, AATKit Flutter plugin provides CMP implementations.

Google CMP Usage

Android requires appId to be added to AndroidManifest, like

<meta-data
          android:name="com.google.android.gms.ads.APPLICATION_ID"
          android:value="YOUR-APP-ID"/>

For iOS you need to set the GADApplicationIdentifier value to the Info.plist file, like:

<key>GADApplicationIdentifier</key>
<string>YOUR-APP-ID</string>

Set Google CMP consent type when initializing AATKit:

await _aatkitFlutterPlugin.initAATKit(
  AATKitConfiguration(
    consent: ManagedConsent(
      cmp: CMPGoogle(),
      listener: ManagedConsentListener(
          managedConsentCMPFailedToLoad: (error) {
            print("[ManagedConsentListenerFlutter] managedConsentCMPFailedToLoad error: $error");
            _aatkitFlutterPlugin.reloadConsent();
          },
          managedConsentCMPFailedToShow: (error) => print(
              "[ManagedConsentListenerFlutter] managedConsentCMPFailedToShow error: $error"),
          managedConsentCMPFinished: (state) => print(
              "[ManagedConsentListenerFlutter] managedConsentCMPFinished state: $state"),
          managedConsentNeedsUserInterface: () {
            print("[ManagedConsentListenerFlutter] managedConsentNeedsUserInterface");
            _aatkitFlutterPlugin.showConsentIfNeeded();
          }),
    ),
  ),
);

SourcePoint CMP Usage

Add SourcePoint dependency to the Android project's build.gradle file.

implementation 'com.sourcepoint.cmplibrary:cmplibrary:7.10.1'

Pass all required SourcePoint values as configuration parameters when initializing AATKit.

await _aatkitFlutterPlugin.initAATKit(
  AATKitConfiguration(
    consent: ManagedConsent(
      cmp: CMPSourcePoint(
        accountId: your-account-id,
        propertyId: your-property-id,
        propertyName: "your-property-name",
        pmId: "your-pm-id",
      ),
      listener: ManagedConsentListener(
          managedConsentCMPFailedToLoad: (error) {
            print("[ManagedConsentListenerFlutter] managedConsentCMPFailedToLoad error: $error");
            _aatkitFlutterPlugin.reloadConsent();
          },
          managedConsentCMPFailedToShow: (error) => print(
              "[ManagedConsentListenerFlutter] managedConsentCMPFailedToShow error: $error"),
          managedConsentCMPFinished: (state) => print(
              "[ManagedConsentListenerFlutter] managedConsentCMPFinished state: $state"),
          managedConsentNeedsUserInterface: () {
            print("[ManagedConsentListenerFlutter] managedConsentNeedsUserInterface");
            _aatkitFlutterPlugin.showConsentIfNeeded();
          }),
    ),
  ),
);

SFBX/AppConsent

Make sure, your SFBX CMP has been set up at its backend dashboard. Our support recommends certain vendors to be included in your server-side setup in order to yield optimal revenues.

Add SFBX/AppConsent dependency to the Android project's build.gradle file.

implementation 'com.sfbx.appconsent:appconsent-ui-v3:5.3.0'

Pass API Key as configuration parameter when initializing AATKit.

await _aatkitFlutterPlugin.initAATKit(
  AATKitConfiguration(
    consent: ManagedConsent(
      cmp: CmpAppConsent(
          appKey: "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxxxxx",
      ),
      listener: ManagedConsentListener(
          managedConsentCMPFailedToLoad: (error) {
            print("[ManagedConsentListenerFlutter] managedConsentCMPFailedToLoad error: $error");
            _aatkitFlutterPlugin.reloadConsent();
          },
          managedConsentCMPFailedToShow: (error) => print(
              "[ManagedConsentListenerFlutter] managedConsentCMPFailedToShow error: $error"),
          managedConsentCMPFinished: (state) => print(
              "[ManagedConsentListenerFlutter] managedConsentCMPFinished state: $state"),
          managedConsentNeedsUserInterface: () {
            print("[ManagedConsentListenerFlutter] managedConsentNeedsUserInterface");
            _aatkitFlutterPlugin.showConsentIfNeeded();
          }),
    ),
  ),
);
IAB TCF
Consent Management Platforms