Interstitial-Anzeige über AdMob in Ionic alle 2 Minuten anzeigen
Ich verwende das AdMob-Plugin in Ionic und mit diesem Code zeige ich eine Interstital-Anzeige:
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();
}
Gibt es eine Möglichkeit, Zwischenanzeigen alle 2 Minuten zu schalten? Jemand sagte mir, ich solle das hinzufügen:setInterval(showInterstitial,1*60*1000)
, aber ich weiß nicht, wo ich hinzufügen soll?