Android Question How to set .tagForChildDirectedTreatment(true) in Admob

quimacama

Member
Licensed User
Longtime User
I've received this mail today:


I have to indicate this to keep my adds
B4X:
AdRequest request =newAdRequest.Builder()
    .tagForChildDirectedTreatment(true)
    .build();
adView.loadAd(request);
How I do it in B4A with FirebaseAdmob?
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use this code:
B4X:
  LoadAdWithTagForChildDirectedTreatment(adview1)
End Sub

Sub LoadAdWithTagForChildDirectedTreatment (ad As AdView)
   Dim jo As JavaObject
   jo.InitializeNewInstance("com.google.android.gms.ads.AdRequest$Builder", Null)
   jo = jo.RunMethodJO("tagForChildDirectedTreatment", Array(True)).RunMethod("build", Null)
   Dim jo2 As JavaObject = ad
   jo2.RunMethod("loadAd", Array(jo))
End Sub
 
Last edited:
Upvote 0

quimacama

Member
Licensed User
Longtime User
Thanks Erel, my level of java is zero but I suppose that the last line is

B4X:
jo2.RunMethod("loadAd",Array(jo))

What about Interstitials? And iAdmob?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…