i have some problems with my setTimeout and setInterval functions. What i need to do is displaying an ad 2 seconds after the app was launched and then display it every 2 minutes. Good, untill now i managed to do the first half of the problem (display it after 2 seconds) but i can't figure it out how to delay the timeout with another 2 minutes and execute it in a loop (probably with setInterval). I tried adding another timeout in this timeout but it delays the first execution.
I would apreciate some help. Here is my code untill now:
setTimeout(function() {
// this will create a banner on startup
AdMob.createBanner( {
adId: admobid.banner,
position: AdMob.AD_POSITION.BOTTOM_CENTER,
overlap: false,
offsetTopBar: false,
bgColor: 'black'
} );
// this will load a full screen ad on startup
AdMob.prepareInterstitial({
adId: admobid.interstitial,
autoShow: true
});
}, 2000);