Hello guys i have a problem, i use cocos creator 1.5 and when i monsters the Interstitial admob (Advertising in full screen) and i click it take me on apple store but when i return to the game this is blocked, How can I fix it?
Code:
Button call:
sdkbox.PluginAdMob.show(‘gameover’);
AdMob.js
admobInit: function() {
if(cc.sys.isMobile) {
var self = this;
sdkbox.PluginAdMob.setListener({
adViewDidReceiveAd: function(name) {
//cc.log('adViewDidReceiveAd name=' + name);
},
adViewDidFailToReceiveAdWithError: function(name, msg) {
//cc.log('adViewDidFailToReceiveAdWithError name=' + name + ' msg=' + msg);
},
adViewWillPresentScreen: function(name) {
//cc.log('adViewWillPresentScreen name=' + name);
},
adViewDidDismissScreen: function(name) {
//cc.log('adViewDidDismissScreen name=' + name);
},
adViewWillDismissScreen: function(name) {
//cc.log('adViewWillDismissScreen=' + name);
},
adViewWillLeaveApplication: function(name) {
//cc.log('adViewWillLeaveApplication=' + name);
}
});
sdkbox.PluginAdMob.init();
}
},
Update 1:
I have add code in AdMob.js
cc.game.on(cc.game.EVENT_HIDE, function (event) {
console.log("AdMob=================================>HIDE TRUE");
});
cc.game.on(cc.game.EVENT_SHOW, function (event) {
console.log("AdMob=================================>SHOW TRUE");
});
Consol Log xcode:
D/AudioEngine-inl.mm (147): UIApplicationWillResignActiveNotification
AdMob=================================>HIDE TRUE
2017-06-16 08:27:30.084016+0200 Game-mobile[13307:3297968] dnssd_clientstub write_all(37) DEFUNCT
2017-06-16 08:27:30.084154+0200 Game-mobile[13307:3297968] dnssd_clientstub deliver_request ERROR: write_all(37, 70 bytes) failed
2017-06-16 08:27:30.084394+0200 Game-mobile[13307:3297968] dnssd_clientstub write_all(37) DEFUNCT
D/AudioEngine-inl.mm (157): UIApplicationDidBecomeActiveNotification
Game is blocked and the console.log(“AdMob=================================>SHOW TRUE”); It does not appear
Update 2:
The game blocked even if you start the Interstitial admob (Advertising in full screen) and while we look at the announcement we go in the background, when we return in the game it will be blocked. To unlock it, we’ll just go back to the background and return to the game. Why is this happening? Is this an issue with AdMob?
Update 3:
Removing in the file AppController.mm in the applicationDidEnterBackground the line
cocos2d::Application::getInstance()->applicationDidEnterBackground();
Everything works perfectly.