Android Question Admob - Designed for Families Requirements

Erel

B4X founder
Staff member
Licensed User
Longtime User
Add this code:
B4X:
#if Java
import com.google.android.gms.ads.*;
import com.google.ads.mediation.admob.*;
import android.os.Bundle;
public void loadAd(AdView ad) {
   Bundle extras = new Bundle();
   extras.putBoolean("is_designed_for_families", true);

   AdRequest request = new AdRequest.Builder()
  .addNetworkExtrasBundle(AdMobAdapter.class, extras)
  .tagForChildDirectedTreatment(true)
  .build();
   ad.loadAd(request);
}
#end if

Load an ad with:
B4X:
Dim meJO As JavaObject 'this can be a global variable
meJO.InitializeContext
meJO.RunMethod("loadAd", Array(adview1))
 
Upvote 0

CyclopDroid

Well-Known Member
Licensed User
Longtime User
Today I received the email from Google implementaton "Designed for Families".
Where i put the code #If Java....?
Hey Jack! I have always used your library (mwAdmobInterstitial2 ver2.0) ... how to implement it?
You are going to do an update of your library about it?
Thanks
 
Upvote 0
Top