Hi I have used Cocoon for packaging my game for both android and ios. I have a problem though the game is not showing interstitials. There are no error bugs. Please have a look at my code. Thanks.
document.addEventListener(“deviceready”, function () {
setTimeout(function () {
if (window.cordova) {
initGame();
configureHeyzap();
if(heyzapService){
//Cocoon.Ad.Heyzap.showDebug();
createHeyzapInterstitial();
}
}
}, 100, false);
});
function configureHeyzap(){
heyzapService = Cocoon.Ad.Heyzap;
console.log(heyzapService);
heyzapService.configure({
ios: {
publisherId:“fca8597331225da69e2768329f5804d7”
},
android: {
publisherId:“fca8597331225da69e2768329f5804d7”
}
});
}
function createHeyzapInterstitial(){
heyzapInterstitial = Cocoon.Ad.Heyzap.createInterstitial();
heyzapInterstitial.on(“load”, function(){
console.log(“Interstitial loaded”);
});
heyzapInterstitial.on("fail", function(){
console.log("Interstitial failed");
});
heyzapInterstitial.on("show", function(){
console.log("Interstitial shown");
});
heyzapInterstitial.on("dismiss", function(){
console.log("Interstitial dismissed");
});
}
function showHeyzapInterstitial(){
if(heyzapInterstitial != undefined){
console.log(heyzapInterstitial + ‘heyzapInterstitial’)
heyzapInterstitial.load();
heyzapInterstitial.show();
}
}