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

quimacama

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

Dear App Developer,

We’re contacting you because Google has received a report that your Android app(s) and package name(s) listed below may be child-directed for the purposes of the Children’s Online Privacy Protection Act (COPPA). You can visit the Federal Trade Commission’s website to learn more about COPPA.

In 30 days, we will take the action to treat your app(s) listed below as primarily child-directed for applicable Google services that may appear in your app(s). For instance, this means AdMob will take steps to disable interest-based advertising and remarketing ads for your app(s).

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
Top