I'm using AdMob plugin in Ionic and with this code I show an Interstital ad:
function initAd(){
// it will display smart banner at top center, using the default options
if(AdMob) AdMob.createBanner( {
adId: admobid.banner,
bannerId: admobid.banner,
position: AdMob.AD_POSITION.BOTTOM_CENTER,
autoShow: true,
isTesting: false,
success: function() {
console.log('banner created');
},
error: function() {
console.log('failed to create banner');
}
});
window.AdMob.prepareInterstitial({
adId:admobid.interstitial, autoShow:false
});
window.AdMob.showInterstitial();
}
Is there a way to show intersitial ad every 2 minutes? Someone told me to add this: setInterval(showInterstitial,1*60*1000)
, but I don't know where to add?