AdMob worked once, then never again

AdMob worked once, then never again
0.0 0

#1

Hey guys.

So I’ve almost finished up on my project, with SDK integration being all that remains. I integrated Admob using the graphical SDKBOX tool, and after initializing and caching in AppDelegate, I attempt to display the ad after checking that it ‘isAvailable’.

So far, it has worked only once, and never after that.

I changed the ID to a test ID in sdkbox_config, but no luck. I appreciate any help I can get!


#2

What do you mean, it worked only once?
The isAvailable api works only once?
which platform ?


#3

I’m working with C++ for Android.

By worked only once, I mean that I actually got it to display the banner ad on my device, but every time I’ve tried after that, it hasn’t worked.

IsAvailable always returns false now, which I don’t understand. I cache the ad in AppDelegate, and then an update continues running until the ad is available, and then it is meant to display.


#4

enable test device hash id for admob, maybe there is issue with admob id u using, also maybe you not making cache ads which preloads ads.


#5

I didn’t include a Test Device ID, as I read in another thread that it’s deprecated. But how do I find out my device’s ID, just so I can cover all stops.
I’m using correct AdMob test IDs however, and I have enabled the test parameter in the sdkbox_config file.

I have tried caching the ad in the delegate, and also tried caching it in the scene its required in. No luck on either front.


#6

its like 99% that issue is on your side due some wrong setup or step, there is 1000 variations what could gone wrong … so best it to post your code /sample project u using


#7

AppDelegate.cpp (2.0 KB)
Start.cpp (1011 Bytes)

I cannot upload the sdkbox_config.json because of its format.

I have cleaned out the irrelevant code to make it easier to comprehend.


#8

xmm just create button on which pressing u call this:

if (sdkbox::PluginAdMob::isAvailable(“home”) )
{
sdkbox::PluginAdMob::show(“home”);
loaded = true;
} else {
sdkbox::PluginAdMob::cache(“home”);

}


#9

Still no luck!

Is there a way for me to know whether the plugin is actually initializing? It would help with the troubleshooting.


#10

1

sdkbox::PluginAdMob::cache("home");

u do not need to call cache manually. Plugin AdMob will cache ads in your sdkbox_config.json.

2

And there is some callback event, like adViewDidReceiveAd:

adViewDidReceiveAd will be invoke when the ad is ready.
Thanks,


#11

I’ve already incorporated the listener, attempting to use adViewDidReceiveAd to display the ad when ready, but once again, it did not work.

At your first point though, does that mean the AdMob plugin can now autocache?

I’m not around my PC right now, but I’ll try it as soon as possible and keep you up to date.


#12

I’m sorry, but what do u mean it did not work?

I notice that, you have a var loaded here, once loaded = true;, bellow code would work only once, because loaded==false.

	if (sdkbox::PluginAdMob::isAvailable("home") && loaded == false)
	{
		sdkbox::PluginAdMob::show("home");
		loaded = true;
	}

any questions, u can fork our sample and pr, I’ll check your code.


#13

Did you figure this out? This sounds like what I’m currently dealing with.

isAvailable was true once (with the sample config json, but set to test: true), but hasn’t worked since. Seems like it might be on some sort of timer. I haven’t tried the test phone id either, good to know its deprecated.

When the ad did show for me, it only flashed the test ad on the screen for a moment before returning back to the main game again.

edit: It seems to be roughly every 10 minutes, I get 2-3 ads before they stop being available (with test: true set). You’d think that setting test would let you bypass that timer.


#14

You should probably check it using a proxy. It sometimes has issues based on the location.


#15

Well, after much tinkering, the only way I was able to solve the problem was to copy my classes to a brand new project, and import only the plugin for Admob alone. It worked after that.
However, despite making no modifications AT ALL since the last time it worked, it doesn’t seem to be working any longer.


#16

maybe you click your AdMob read ad too many times.
emmm, plz mark the title as solved.

Thanks,