Closed gregstein closed 8 years ago
Thank you so much mate! I have removed some of the alerts, is it gonna work like this ?
<script type="text/javascript">
function showInterstitial(){
admob.isInterstitialReady(function(isReady){
if(isReady){
admob.showInterstitial();
}else{
}
});
}
alert("load fail: "+message.type+" "+msg);
}
function onDeviceReady() {
admob.initAdmob("banner ID","interstitial ID");
document.addEventListener(admob.Event.onInterstitialReceive, onInterstitialReceive, false);
document.addEventListener(admob.Event.onInterstitialFailedReceive,onReceiveFail, false);
}
document.addEventListener('deviceready',onDeviceReady, false);
</script>
function onInterstitialReceive (message) {
admob.showInterstitial();//show when load success
}
function onReceiveFail (message) {
var msg=admob.Error[message.data];
if(msg==undefined){
msg=message.data;
}
admob.cacheInterstitial();//load again when load fail
alert("load fail: "+message.type+" "+msg);
}
function onDeviceReady() {
admob.initAdmob("banner ID","interstitial ID");//init admob
document.addEventListener(admob.Event.onInterstitialReceive, onInterstitialReceive, false);
document.addEventListener(admob.Event.onInterstitialFailedReceive,onReceiveFail, false);
admob.cacheInterstitial();// start load
}
document.addEventListener('deviceready',onDeviceReady, false);
Thank you so much <3
Hi, It's been two days now and I couldn't figure a way to show interstitial ad. Could someone help me with please ?
Thank you in advance,