Guys
in an attempt to ensure my ads were ready to be displayed I put the following code into my AppDelegate::applicationDidFinishLaunching() method:
// cache ads first thing…
/#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
CCLOG(“AppDelegate::applicationDidFinishLaunching sdkbox::PluginAdMob::cache ‘level_1_IOS’, ‘level_2_IOS’, ‘level_3_IOS’, ‘menu_IOS’”);
sdkbox::PluginAdMob::cache(“LEVEL_1_IOS”);
sdkbox::PluginAdMob::cache(“LEVEL_2_IOS”);
sdkbox::PluginAdMob::cache(“LEVEL_3_IOS”);
sdkbox::PluginAdMob::cache(“MENU_IOS”);
/#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
CCLOG(“AppDelegate::applicationDidFinishLaunching sdkbox::PluginAdMob::cache(‘LEVEL_1’, ‘LEVEL_2’, LEVEL_3’, ‘MENU’)”);
sdkbox::PluginAdMob::cache(“LEVEL_1”);
sdkbox::PluginAdMob::cache(“LEVEL_2”);
sdkbox::PluginAdMob::cache(“LEVEL_3”);
sdkbox::PluginAdMob::cache(“MENU”);
/#endif
I discovered only the LAST ad was being cached and displayed. By the way this bug is NOT evident in the iOS build only in Android.
To cache the ads sequentially I put the following code into my AdMobEventListener and ONLY cached thr MENU ad in the AppDelegate method:
void AdMobEventListener::adViewDidReceiveAd(const std::string &name) {
CCLOG(“AdMobEventListener::adViewDidReceiveAd( %s )”, name.c_str());
if(name.compare(“MENU”)==0) {
CCLOG(“AdMobEventListener::adViewDidReceiveAd sdkbox::PluginAdMob::cache(‘LEVEL_1’)”);
sdkbox::PluginAdMob::cache(“LEVEL_1”);
}
else if(name.compare(“LEVEL_1”)==0) {
CCLOG(“AdMobEventListener::adViewDidReceiveAd sdkbox::PluginAdMob::cache(‘LEVEL_2’)”);
sdkbox::PluginAdMob::cache(“LEVEL_2”);
}
else if(name.compare(“LEVEL_2”)==0) {
CCLOG(“AdMobEventListener::adViewDidReceiveAd sdkbox::PluginAdMob::cache(‘LEVEL_3’)”);
sdkbox::PluginAdMob::cache(“LEVEL_3”);
}
}
This seems to work