Android [SOLVED] AdMob Ads not showing

Discussion in 'Programming' started by Dan1, Feb 22, 2018.

  1. Dan1

    Dan1 Member

    Joined:
    Jun 22, 2016
    Posts:
    163
    Hey everyone,

    I'm struggling to get the banner and interstitial ads to show, for some reason nothing is happening when I attempt to run them.

    I've set up the admobs account and have the following set up

    Game start:
    Code:
    GoogleMobileAds_Init("ca-app-pub-XXX")
    Create event in-game:
    Code:
    GoogleMobileAds_LoadInterstitial();
    GoogleMobileAds_AddBannerAt("ca-app-pub-XXX",GoogleMobileAds_Banner,0,0)
    
    Social event in-game (same object):
    Code:
    GoogleMobileAds_MoveBanner((abs(display_get_width()-GoogleMobileAds_BannerGetWidth()))/2, 0);
    And just before you exit the level:
    Code:
    GoogleMobileAds_ShowInterstitial();
    
    Android settings:
    [​IMG]

    AdMob page:
    [​IMG]

    And yet, nothing! No banner and no interstitial!

    I'm not sure if I'm missing something obvious? Any help is appreciated! :)

    Thanks,
    Dan
     
    Last edited: Feb 23, 2018
  2. Hrishi

    Hrishi Member

    Joined:
    Feb 21, 2018
    Posts:
    6
    Did you try with the test id? You do not want to use the admob id while testing as that might lead to your account been banned. (Requests from a single device)

    GoogleTest Ad id for interstitial
    ca-app-pub-3940256099942544/1033173712

    Also are you testing the app after building the .apk and running it on the phone? The ads wont show up on the Test VM on your desktop. They only show up when the .apk is run on a phone.

    Also check if you have Google Play services extension installed and activated.

    https://help.yoyogames.com/hc/en-us/articles/216754558-Ads-Google-Mobile-Advertising-v1-3-
     
  3. Dan1

    Dan1 Member

    Joined:
    Jun 22, 2016
    Posts:
    163
    I have been testing it after building the APK and running it on my phone - I have a bit of trouble getting the test ads going as I've not been able to connect the phone with Gamemaker for some reason so I left test ads off but they just didn't show up at all - so test ads on or not you'd think something would show up?
     
  4. Alex_Beach

    Alex_Beach Member

    Joined:
    Jan 9, 2018
    Posts:
    217
    Are you sure you are using the correct ad unit ID that is given to you on the individilual ads you made on AdMob? Also, make sure you check to see if the ad is loaded before calling to load them. The game has to load the ad into memory first and this can take about 2 to 5 seconds.
     
  5. Dan1

    Dan1 Member

    Joined:
    Jun 22, 2016
    Posts:
    163
    Ah I've got it sorted now, I've updated everything on the SDK manager, updated Java and it's just started working - not sure what it was that fixed it but it's all okay now :)
     
  6. Uberpink

    Uberpink Member

    Joined:
    Oct 16, 2016
    Posts:
    157
    EDIT: (probably because i use newer ekstension, old ekstension needed only one afaik)

    nice posts. i have a question to u pros... im using this line with my admob code (ok, should use the testcode,but..) trying interstitial ad

    GoogleMobileAds_Init("ca-app-pub-9235698069544896/3211054688");

    but it is red, like it has some errors, and ofcourse compiling then doesent work.... why is it red? others using that line without problem,, i have added the googleplay services in the ekstensions also ingame (but do it have to be activated or something?).....
     
    Last edited: Jul 26, 2018

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice