Add Ad Consent Message for European Users — AdMob GDPR with Flutter

Tiempo de lectura: 2 minutos

Today we are going to learn how to implement the mandatory consent message from Google AdMob, which will be requested from European users by the GDPR or GPDR law or Data Protection who want to view the ads of the APP with AdMob.

We are going to use the official AdMob package for Flutter (https://developers.google.com/admob/flutter/eu-consent?hl=en-419)

Returns only the HTML translated, without any addition.

google_mobile_ads: ^4.0.0

Now let’s apply the following:

In the case of iOS

We must request App Tracking Transparency, for this we go to the Info.plist file and add:

We also add this key:

And after adding the key, you need to add the AppTrakingTransparency.framework library using Xcode:

Part of Android / iOS

Let’s create a widget called ConsentAds.dart

To use it, go to the main screen and add the following:

In the case of Android, go to android\app\src\main\AndroidManifest.xml of our app and add:

And when running our APP it will appear:

Leave a Comment