• 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!

Android/iOS problem with ads?

W

wkaudio

Guest
I can not get banner ads to show up. My AdMob account is 100% set up and I created the Ad Unit about 2 days ago now. I don't have an android device myself to test on, but my artist (who tested the app on his phone) confirmed he gets no ads.

This is my current code:

In the creation code of rm_init, which starts the game:
Code:
if os_type = os_ios {
   global.app_id = [ios app id];
   global.banner_id = [ios banner id];
} else {
   global.app_id = [android app id];
   global.banner_id = [android banner id];
}

GoogleMobileAds_UseTestAds(true,[test ad id]);

GoogleMobileAds_Init(global.banner_id, global.app_id);

//In this code I also initialize other variables for the game here, but they are irrelevant to the ads.

room_goto_next();
And then on my title screen, in obj_title (which controls the whole room):

Code:
//Create Event:

//...After some other variables and things unrelated to ads
GoogleMobileAds_AddBanner(global.banner_id,GoogleMobileAds_Banner); //Interestingly, this line gives me a warning saying global.banner_id is only referenced once, is it a glitch or is it not being picked up from rm_init?
var bw = GoogleMobileAds_BannerGetWidth();
var bh = GoogleMobileAds_BannerGetHeight();
var dw = display_get_width();
var dh = display_get_height();
GoogleMobileAds_MoveBanner(bw / 2 - dw / 2, bh - dh)
GoogleMobileAds_ShowBanner();
I get no errors in GMS2 from this, but xCode gives me this error when it runs the game:
Code:
2019-06-12 20:13:29.339148-0700 [project_name] banner ad failed to receive
I've done some searching around but haven't seemed to find the solution to my problem.

This is one of the last steps before my game is ready to release, so if anyone can offer help it would be greatly appreciated. Thank you!
 

rIKmAN

Member
Is that your actual code, or are the square brackets around app id and banner id just to signify that's where you entered have your actual ids?

Also, I'd 100% recommend you get yourself a cheap Android device, it's going to be impossible for you to test your own game on a device and debug issues you will get along the way otherwise.
 
W

wkaudio

Guest
Is that your actual code, or are the square brackets around app id and banner id just to signify that's where you entered have your actual ids?

Also, I'd 100% recommend you get yourself a cheap Android device, it's going to be impossible for you to test your own game on a device and debug issues you will get along the way otherwise.
I redacted my actual ids. I remember reading somewhere they should be kept confidential.

I can get a galaxy s6 for around $80 and payday is in a few days, so that's the plan. Thanks for the tip :)
 

rIKmAN

Member
I redacted my actual ids. I remember reading somewhere they should be kept confidential.

I can get a galaxy s6 for around $80 and payday is in a few days, so that's the plan. Thanks for the tip :)
Yeah you should keep them private - I was wondering if you were creating an array without realising, but reading it again it would give an error anyway due to the spaces in "ios app id" etc. It's late! :)

Yeah it's always best to have at least 1 actual device, preferably a few (low-end, mid-range, high end, phone / tablet etc) but definitely at least something that you can use to test yourself other than the emulators.

I've never used any of the emulators, but can you run the game on them in debug mode and check the adb log output to see what that says?

If not, when you get your device enable Dev Mode and USB Debugging and run the game in debug mode with it connected via USB, you might get a better error message and be able to work out what is happening.

Have you also tried turning test ads off and using real ads?
 
W

wkaudio

Guest
Yeah you should keep them private - I was wondering if you were creating an array without realising, but reading it again it would give an error anyway due to the spaces in "ios app id" etc. It's late! :)

Yeah it's always best to have at least 1 actual device, preferably a few (low-end, mid-range, high end, phone / tablet etc) but definitely at least something that you can use to test yourself other than the emulators.

I've never used any of the emulators, but can you run the game on them in debug mode and check the adb log output to see what that says?

If not, when you get your device enable Dev Mode and USB Debugging and run the game in debug mode with it connected via USB, you might get a better error message and be able to work out what is happening.

Have you also tried turning test ads off and using real ads?
With test ads off, I still get the xCode "banner ad failed to receive" message.

My iOS has developer mode enabled, but when I run the game in debug mode, xCode gets stuck saying it's waiting for the debugger to connect and the game does not actually launch on the phone. This also happens in the iOS emulators.

And I'm a bedroom developer, this project has had a budget of about $15 and that has gone toward coffee keeping me up to work ;) I'd love to have all those devices but it's unrealistic for me at this time. Ideally, for now, I'll have at least one device on each target OS. If my projects ever take off I can make the investment in more hardware!
 
W

wkaudio

Guest
Bump because the issue has... changed.
The ads now show up maybe 1/10th of the time? Most of the time I get the "banner ad failed to receive" message, sometimes they show up just fine. Is this something out of my control?
 
Top