Software Archive
Read-only legacy content
17061 Discussions

Admob Interstitial ads

Josef_J_
Beginner
266 Views
Hi everyone , need Help !

I am showing admob banner ads (admobpro plugin) and would like to show Interstitial ad when the user closes the app , how should my code look like ? , any help would be appreciated !


this is The code i use for banner ads 



<script>
var admobid = {};
if( /(android)/i.test(navigator.userAgent) ) { 
    admobid = { // for Android
        banner: 'ca-app-pub-4244161648326484/2972750652',
        interstitial: 'ca-app-pub-4244161648326484/4449483854'
    };
} else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {
    admobid = { // for iOS
        banner: 'ca-app-pub-4244161648326484/2972750652',
        interstitial: 'ca-app-pub-4244161648326484/4449483854'
    };
} else {
    admobid = { // for Windows Phone
        banner: 'ca-app-pub-4244161648326484/2972750652',
        interstitial: 'ca-app-pub-4244161648326484/4449483854'
    };
}

function initApp() {
    if (AdMob) {
        AdMob.createBanner({
            adId : admobid.banner,
            position : AdMob.AD_POSITION.BOTTOM_CENTER,
            autoShow : true
        });
        
        
    }
}

document.addEventListener('deviceready', initApp, false);
</script>

  Thanks

0 Kudos
1 Reply
Josef_J_
Beginner
266 Views

Or maybe instead of the Splash screen when the app starts to show only once !

 

Thanks

0 Kudos
Reply