• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android [SOLVED] AdMob not showing

S

Siracher

Guest
Hi all

I just followed this tutorial to implement admob in mygame:
https://help.yoyogames.com/hc/en-us/articles/216754558-Ads-Google-Mobile-Advertising-v1-3-

The tutorial is not up to date for GMS2, but I thinks I have implemented everything necessary:
- Installed Google Play Services as extension
- created an object at the Game startup and used this code in the Create event:
GoogleMobileAds_Init("");
- added this code in the object, when the game-over screen is showing up (in the create event)
GoogleMobileAds_AddBannerAt("ca-app-pub-6491754804335xxxxxxxxxx", GoogleMobileAds_Banner, 0, 0);


does anybody know where I made the mistake?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
What is your error? Are you using the correct Target/min/max SDK's? Iirc, admob requires a higher minimum SDK than 9 (which is the GMS default).
 
S

Siracher

Guest
Hi Nocturne

yes the min SDK was on 9. I just updated it to 14, but still no ad is showing up

Build Settings:
Build tools 23.0.1
Support Library: 23.0.0
Target SDK: 23
Minimum SDK: 14
Compile SDK: 23

I tested on my Galaxy S7 with YYC. I also uploaded an APK to the Playstore as Betatest.

In the output I get now tons of these lines:
Use AdRequest.Builder.addTestDevice("54624592F7DDFC164B7C061D35642E11") to get test ads on this device.
 
S

Siracher

Guest
Hi Ednei

thanks, yes I already mentioned this extension but wanted to build it without an additional extension.
I mean it should work with the basic tools right?

Does anybody have a game created with GMS2 and was able to get admob running without an extra extension?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
I'm still waiting to hear what the error is? If you are getting a message about test ads then that would imply that it's working fine. Oh, and you do NOT need third party extensions other than those that YYG make to get ads to work.
 
S

Siracher

Guest
oh sorry, I need to check carefully the output, but yesterday I saw only several lines with the test ads, no error.
I'll check today again.

Maybee it is just a small thing. Is it correct to place the add in the create event of the object (in my case game-over object)?
I don't think there's a depth setting, that the add is hidden behind the actual content?

I have donloaded the Play Service Extension and confirmed that it is installed

sorry for the stupid questions, I'm quite new to Game Maker and spent the whole evening yesterday to get this running :confused:
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Okay, well, the first thing I would do is actually use the test ads as the Output suggests. Iirc, you can use the device ID that is shown in the output message within the GMS extension functions to call ads for testing. You should test using that, and if the ads show up then everything is fine and working as it should... it could be that you need to wait a few days to get ads served (this is pretty common, and the last time I had to work with ads it was over 24 hours before I got my first "real" ads served to my device). And yes, calling that in the Create Event should be fine. :)
 
S

Siracher

Guest
I just included this code in the same object as the AdMobi Init:
GoogleMobileAds_UseTestAds(true, "54624592F7DDFC164B7C061D340DF34E")

the console shows now tons of line: Starting ad request.
but nothing shows up on the screen.

Any other idea why it isn't working?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Could you post a bit of the console output please? Just want to see what's being shown...
 
S

Siracher

Guest
ok the setting seem to be fine. I just made a copy of the game and left the settings for sdk etc.
I deleted everything except 1 room and 1 object and placed the code. It is working fine now :D

So I knew it must be a problem somewhere in the game. And this is what happened:
I create an object for the ads in a stepevent :eek: So each step of the game a new object was create and the add had no chance to show up.
Therefore I received also these endless lines of ad is loading...

I managed to avoid this by adding an if statement to check if the object exists.
but the add still does not show up, but I'm sure I'll find out now

thanks everyone
 
S

Siracher

Guest
ah bummer, harder than expected...

first in the console it says requesting ad, then there's the error that the ad is not visible and therefore not showing.
the ad is placed at 0,0 and the layer is on top of the other layers.

Does anybody know how to solve this?
 
S

Siracher

Guest
quick update, it works now.
Only thing I had to do is restart my phone :rolleyes:
 
Top