Hi,
I’m attempting to load multiple admob banners in my game. Problem is that I only get the last one I try to cache.
I’ve in AppDelegate.cpp
bool AppDelegate::applicationDidFinishLaunching() {
.....
#ifdef SDKBOX_ENABLED
sdkbox::PluginAdMob::init();
sdkbox::PluginReview::init();
sdkbox::PluginAdMob::cache("banner1");
sdkbox::PluginAdMob::cache("banner2");
sdkbox::PluginAdMob::cache("banner3");
#endif
....
}
And in the update() method of the scene 1/2/3 (each banner is assigned to one scene), I’ve:
.....
#ifdef SDKBOX_ENABLED
if (sdkbox::PluginAdMob::isAvailable("banner1")) // or banner2 / banner3 depending on scene
{
sdkbox::PluginAdMob::show("bannerContinueScene");
}
#endif
....
}
But when I run my project, the only banner I can see is the last one I attempted to cache(), in this case would be “banner3”, and it’s as if sdkbox couldn’t cache ‘banner1’ & ‘banner2’ or they were uncached when attempting to cache ‘banner3’.
If I reorder the cache() calls in didFinishLaunching, the banner displayed (in respective scene) is the one that shows then.
The Admob part in my sdkbox_config.json is:
"AdMob": {
"test": false,
"ads": {
"banner1": {
"width": 320,
"type": "banner",
"id": "ca-app-pub-BUNCH-OF-NUMBERS AD 1",
"alignment": "bottom",
"height": 50
},
"banner2": {
"width": 320,
"type": "banner",
"id": "ca-app-pub-BUNCH-OF-NUMBERS AD 2",
"alignment": "bottom",
"height": 50
},
"banner3": {
"width": 320,
"type": "banner",
"id": "ca-app-pub-BUNCH-OF-NUMBERS AD 3",
"alignment": "bottom",
"height": 50
}
}
}