Skip to content

Instantly share code, notes, and snippets.

@Prav92
Last active June 24, 2021 13:44
Show Gist options
  • Save Prav92/b4b8ac868d33e980c84bf668d212bd49 to your computer and use it in GitHub Desktop.
Save Prav92/b4b8ac868d33e980c84bf668d212bd49 to your computer and use it in GitHub Desktop.
var admobid={}
if( /(android)/i.test(navigator.userAgent) ) {
admobid = { // for Android
banner: 'ca-app-pub-xxxxx/xxxxx',
interstitial: 'ca-app-pub-xxxxxx/xxxxxx'
}
}
else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {
admobid = { // for iOS
banner: 'ca-app-pub-xxxxxxx/xxxxxxx',
interstitial: 'ca-app-pub-xxxxxxx/xxxxxxxx'
};
}
else {
admobid = { // for Windows Phone
banner: 'ca-app-pub-xxxxxxx/xxxxxxx',
interstitial: 'ca-app-pub-xxxxxxx/xxxxxxxx'
};
}
//code for pop-up-ads
if(AdMob) AdMob createBanner({
adId:admobid.banner,
position:AdMob.AD_POSITION.BOTTOM_CENTER,
autoShow:true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment