Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Anni2D · Aug 29, 2014 at 04:38 PM · iosadmob

Admob not working

I am trying to display interstitial ads in my game. I have built the project for iOS and tried to run. I got following message in console;

 <Google> To get test ads on this device, call: request.testDevices = @[ @"b9ade3b76dd9d16ccc6c61b78bf7d427" ];

I have entered my device ID in unity code. But still ads won't display. I have followed sample code from GoogleMobileAdsDemoScript file.

 private AdRequest createAdRequest()
     {
         return new AdRequest.Builder()
                 .AddTestDevice("device id here")
                 .AddKeyword("game")
                 .TagForChildDirectedTreatment(false)
                 .AddExtra("color_bg", "454545")
                 .Build();
         
     }

I can't understand what I am doing wrong. I am using Unity 4.5.3. Please help me. Thanks.

Comment
Add comment · Show 3
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 froYo · Aug 30, 2014 at 01:26 AM 0
Share

This may not be the issue but i thought i'd ask anyway just in case. Are you you showing the ad once it's loaded?

Interstitial ads require you to "show" the ad once loaded, if you are not calling

 interstitial.Show();

Then the ad may have loaded but will never be shown to the player.

avatar image Anni2D · Aug 30, 2014 at 07:15 AM 0
Share

@froYo thanks for reply. Yes I am calling show function on successful interstitial load callback. But unfortunately, ads couldn't be generated as per above message on console. What can I do for that?

avatar image froYo · Aug 30, 2014 at 09:43 PM 0
Share

Perhaps just try the basic code to load an interstitial? Then see if there's still a problem.

 AdRequest request = new AdRequest.Builder()
 .AddTestDevice("device id here")
 .Build();

You could also use the admob events to output data to a GUI.Label or something to see if AdLoaded or AdFailedToLoad are producing any messages.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by gMichael · Sep 30, 2014 at 10:37 AM

Hi had the same problem you need a bool variable and move the interstitial.Show(); function in the update area. Now the ad is displayed when it is loaded.

 private bool adIsOn;
 
 void Update () {
         if (adIsOn != true) {
             if (interstitial.IsLoaded()) {
                 adIsOn = true;
                 interstitial.Show();
             }
         }
 .......
Comment
Add comment · 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

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

Mopub Mediation iOS 1 Answer

Admob on IOS not working 1 Answer

Game crashes when calling RequestBanner() AdMob on iphone 6 0 Answers

Unity Google AdMob Xcode: When I want to run my game on my iPhone with Xcode i have an error 4 Answers

Admob Memory Issues 0 Answers


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