# Managed Consent

### Introduction

AATKit’s Managed Consent is an easy way to facilitate [IAB TCF](https://iabeurope.eu/transparency-consent-framework/) compliant third-party [Consent Management Platforms](https://iabeurope.eu/tcf-for-cmps/) (CMPs) by providing a unified API and wrappers.

### **Google CMP Usage**

It's possible to define consent type when initailizing AATKit, like:

```javascript
aatkit.initWithConfiguration({
    "testModeAccountId": 136,
    "useGeoLocation": false,
    "consentRequired": true,
    "consent": {
        "type": "managedCMPGoogle"
    }
});
```

Next app is able to listen to the event which is triggered when it's required to show consent dialog to the user. Here, `showConsentDialogIfNeeded` function shows the CMP window:

```javascript
document.addEventListener('managedConsentNeedsUserInterface', function(){
  console.log("[AATKit] managedConsentNeedsUserInterface js delegate");
  aatkit.showConsentDialogIfNeeded();
});
```

To let consent dialog work correctly you need Google ID from Funding Choices. Please put ID in the `platforms/ios/MyApp/MyApp-Info.plist` file:

```xml
    <key>GADApplicationIdentifier</key>
    <string>YOUR_APP_ID</string>
```

And in the `platforms/android/app/src/main/AndroidManifest.xml` file:

```xml
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="YOUR_APP_ID" />
```
