- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
iam using this script to show my admob but i dont want the banner to show only the interstitial.
now both shows up, can i remove the banner and only show the interstitial?
can someone help me?
thanks:)
<script src='cordova.js'></script>
<script type="text/javascript">
var onDeviceReady=function(){
navigator.splashscreen.hide();
initAdMob();
showAdMobInterstitial();
showAdMobBanner();
};
document.addEventListener("deviceready",onDeviceReady,false);
function initAdMob(){
if ( window.plugins && window.plugins.AdMob ) {
var admob_key_banner = "xx";
var admob_key_interstitial = "xx";
window.plugins.AdMob.setOptions( {
publisherId: admob_key_banner,
bannerAtTop: true, // set to true, to put banner at top
overlap: false, // set to true, to allow banner overlap webview
offsetTopBar: true, // set to true to avoid ios7 status bar overlap
interstitialAdId: admob_key_interstitial,
autoShow: true, // autoshow intertitial Ad
isTesting: false // receiving test ad
});
} else {
alert("AdMob plugin not ready");
}
}
function showAdMobBanner(){
window.plugins.AdMob.createBannerView();
}
function showAdMobInterstitial(){
window.plugins.AdMob.createInterstitialView();
}
</script>
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recommend removing all references to properties and methods including "banner" in the name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for your replay.
function destroyAdMobBanner(){
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
do you build this function (destroyAdMobBanner) or it exists in the plugin?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i changed this line in the plugin:
}
function showAdMobBanner(){
window.plugins.AdMob.createBannerView();
}
function showAdMobInterstitial(){
window.plugins.AdMob.createInterstitialView();
}
}
function destroyAdMobBanner(){
window.plugins.AdMob.createBannerView();
}
function showAdMobInterstitial(){
window.plugins.AdMob.createInterstitialView();
}
Here is the whole code without the admob banner, only interstitial:
intel xdk plugin---------->com.rjfun.cordova.plugin.admob. And check the Plugin is located in the Apache Cordova Plugins Registry
<script src='cordova.js'></script>
<script type="text/javascript">
var onDeviceReady=function(){
navigator.splashscreen.hide();
initAdMob();
showAdMobInterstitial();
showAdMobBanner();
};
document.addEventListener("deviceready",onDeviceReady,false);
function initAdMob(){
if ( window.plugins && window.plugins.AdMob ) {
var admob_key_banner = "yourkey";
var admob_key_interstitial = "yourkey";
window.plugins.AdMob.setOptions( {
publisherId: admob_key_banner,
bannerAtTop: true, // set to true, to put banner at top
overlap: false, // set to true, to allow banner overlap webview
offsetTopBar: true, // set to true to avoid ios7 status bar overlap
interstitialAdId: admob_key_interstitial,
autoShow: true, // autoshow intertitial Ad
isTesting: false // receiving test ad
});
} else {
alert("AdMob plugin not ready");
}
}
function destroyAdMobBanner(){
window.plugins.AdMob.createBannerView();
}
function showAdMobInterstitial(){
window.plugins.AdMob.createInterstitialView();
}
</script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@John> thank you

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page