Google AdMob plugin for Cordova, Phonegap and Intel XDK ,support ios and android,support admob v1 and admob v2 ,Monetize your html5 app with one javascript line.api is easy to use.
You have earlier provided me with the interstitial code. I have added to my banner code, but only the banner works. Here is the code:
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("ca-app-pub-xxxxxxx","ca-app-pub-xxxxx");//init admob
document.addEventListener(admob.Event.onInterstitialReceive, onInterstitialReceive, false);
document.addEventListener(admob.Event.onInterstitialFailedReceive,onReceiveFail, false);
admob.cacheInterstitial();// start load
admob.showInterstitial();
}
document.addEventListener('deviceready',onDeviceReady, false);
function onDeviceReady() {
admob.initAdmob("ca-app-pub-xxxxxx","ca-app-pub-xxxxxx");
admob.showBanner(admob.BannerSize.BANNER,admob.Position.BOTTOM_APP);//show banner at the top of app
}
document.addEventListener('deviceready',onDeviceReady, false);
Hello,
You have earlier provided me with the interstitial code. I have added to my banner code, but only the banner works. Here is the code: