I'm using AdMob to serve ads to users in EU. The documentation states that I can pass the user consent status by the following line of code:
AdRequest request = new AdRequest.Builder() .AddExtra("npa", "1") .Build();
The problem is that this line does not compile. There is no such function as AddExtra on the AdRequst object. I do use the latest AdMob library available.
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-ads:15.0.1'
So, how do I actually pass this "npa" value to AdMob.
Anyone?
you can add npa using
addNetworkExtrasBundle
method which like bellowAnd also please check bellow official link
https://developers.google.com/admob/android/eu-consent#forward_consent_to_the_google_mobile_ads_sdk