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 /
  • Help Room /
avatar image
0
Question by futbolista · Dec 19, 2017 at 11:06 PM · adsnot workingadmobbanner

AdMob banner ad not showing!

Hello everyone!

I need some help. Our game is almost done and one of the last things that are left are adding some ads to it. I've done it before and it works in other of our games. But now the banner ad isn't showing at all! I haven't tried with interstitial ads or rewarded videos yet. It is working in the editor (I'm getting the "Dummy Initialize", "Dummy LoadAd", "Dummy CreateBannerView"), but not on an actual android device. It isn't working with test ads either!

First I'm initialising in with the script:

using System.Collections; using System.Collections.Generic; using UnityEngine; using GoogleMobileAds; using GoogleMobileAds.Api;

public class InitialiseAds : MonoBehaviour {

 // Use this for initialization
 void Start () {


if UNITY_ANDROID

    string appId = "ca-app-ID...";

elif UNITY_IPHONE

        string appId = "ca-app-ID...";

else

        string appId = "unexpected_platform";

endif

     // Initialize the Google Mobile Ads SDK.
     MobileAds.Initialize(appId);
 }
 

}

and then after that script I'm creating and loading the banner ad through that script:

using System.Collections; using System.Collections.Generic; using UnityEngine; using GoogleMobileAds; using GoogleMobileAds.Api;

public class BannerScript : MonoBehaviour {

 private BannerView bannerView;
 
 // Use this for initialization
 void Start () {
     this.RequestBanner();
 }

 private void RequestBanner()
 {

if UNITY_ANDROID

        string adUnitId = "ca-app-pub-unitID";

elif UNITY_IPHONE

        string adUnitId = "ca-app-pub-unitID";

else

    string adUnitId = "unexpected_platform";

endif

     // Create a 320x50 banner at the top of the screen.
     bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);

     // Create an empty ad request.
     AdRequest request = new AdRequest.Builder().Build();

     // Load the banner with the request.
     bannerView.LoadAd(request);
 }

}

Unity version: 2017.2.0f3 Google AdMob version: 3.10.0

P.S: Sorry about my script looking that bad, I don't know why it is so ugly-looking.

Thank you in advance and have a great holidays! :)

Comment
Add comment · Show 1
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 Bill_G241 · Apr 25, 2021 at 01:59 PM 0
Share

Hello, Did you find a solution? If so, can you please post it. Thanks

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bill_G241 · Apr 26, 2021 at 08:55 AM

I found a solution. Check this post https://answers.unity.com/questions/1832325/banner-admob-is-not-showing-on-android.html?childToView=1832350#answer-1832350

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

123 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I would like to move the banner ad location of Unity AdMob to the location I want. 0 Answers

Admob Banner Has Shown Only Twice in Two Weeks 0 Answers

Banner Admod not always showing! 0 Answers

Admob & Chartboost ads suddenly not working. 1 Answer

Admob banner not showing 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