Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by ZuPe2112 · Mar 07, 2016 at 04:11 PM · c#adsadmob

Using AdMob with the Designed for Families programme

Hello,

i have integrated AdMob in my game, now i'm trying to make ads compliant with Google Designed for Families programme. What i've found is that AdMob offers tools to show compliant ads, as it is explained here:

https://support.google.com/admob/answer/6223431?hl=en-GB

Now the problem is that they mention a method that i can't find: addNetworkExtrasBundle. This is the code shown in their example:

 Bundle extras = new Bundle();
 extras.putBoolean("is_designed_for_families", true);
 
 AdRequest request = new AdRequest.Builder()
         .addNetworkExtrasBundle(AdMobAdapter.class, extras)
         .tagForChildDirectedTreatment(true)
         .build();

That method is not defined anywhere, and I can't find Bundle class either. I also tried something like this (the only choice to add extras):

 AdRequest request = new AdRequest.Builder().TagForChildDirectedTreatment(true).AddExtra("is_designed_for_families", "true").Build();

but the app doesn't show any ad with this code. Anyway ads worked properly when i simply used AdRequest.Builder().Build(), but this doesn't give any control on ads content.

I know i can configure ads in AdMob units from their website, but I'm afraid I could make some mistake about selecting proper ads categories to be shown. I would prefer to use a safe tool like the one mentioned in google support.

I'm using AdMob plugin version 2.3.1. Anyway i've tried to download version 3.0.2 also, but i still can't find that method to add network extras.

I've searched everywhere but i can't find a solution; i've read something about mediation, but i think it is useless as i'm not using any other ad network apart of AdMob.

Please help me, any suggestion would be very appreciated. Thanks in advance.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by kob_2015 · Mar 18, 2016 at 09:55 AM

Hi @ ZuPe2112 ,

You need to update the admob's plugin. You must replace the code below in the class Utils.cs:

    foreach (KeyValuePair<string, string> entry in request.Extras)
        {
             bundle.Call("putString", entry.Key, entry.Value);
         }

by

 foreach (KeyValuePair<string, string> entry in request.Extras)
        {         if (entry.Key == "is_designed_for_families")
                       {
                           if (entry.Value== "true")
                              bundle.Call("putBoolean", entry.Key, true);
                           else
                             bundle.Call("putBoolean", entry.Key, false);
                        }
                  else
                       {
                              bundle.Call("putString", entry.Key, entry.Value);
                        }
        }
 


Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ZuPe2112 · Mar 23, 2016 at 10:26 PM 0
Share

Hello @kob_2015,

thanks for your help, but this doesn't seem to work. I replaced the code as you explained and then i used this to instantiate the request object:

 AdRequest request = new AdRequest.Builder()
     .TagForChildDirectedTreatment(true)
     .AddExtra("is_designed_for_families", "true")
     .Build();


Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

IAds Banner help. If IAds isn't showing show admob. 1 Answer

what do you do after setting up admob in the unity editor 0 Answers

Unity Admob not showing production ads [SOLVED] 1 Answer

Interstitial and scrip admob 0 Answers

Google Admob Events not being called 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges