ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
495 stars 210 forks source link

Banner ads "Internal error" showing but Interstitial ad showing perfectly #205

Open abhishek-kumar97 opened 6 years ago

abhishek-kumar97 commented 6 years ago

document.addEventListener('deviceready', function() { admob.banner.config({ id: admobid.banner, isTesting: true, autoShow: true, }) admob.banner.prepare() admob.interstitial.config({ id: admobid.interstitial, isTesting: false, autoShow: false, }) admob.interstitial.prepare()

}, false)

document.addEventListener('admob.banner.events.LOAD_FAIL', function(event) { console.log(event) })

document.addEventListener('admob.interstitial.events.LOAD_FAIL', function(event) { console.log(event) })

document.addEventListener('admob.interstitial.events.LOAD', function(event) { console.log(event) document.getElementById('showAd').disabled = false })

document.addEventListener('admob.interstitial.events.CLOSE', function(event) { console.log(event)

admob.interstitial.prepare() })

interstitial ad are showing perfectly but banner ad is not showing but for test ads it show always. error:0 Internal error occur when i insert my publisher id. at starting it showed banner ad but after closing the app and opening it again no banner ad displayed

vindiola911 commented 6 years ago

Had this same problem but figured it out. Instead of admob.banner.config({ id: admobid.banner, isTesting: true, autoShow: true, }) and admob.banner.prepare(), just do admob.banner.prepare({ id: admobid.banner, isTesting: true, autoShow: true, }).

bflopez commented 6 years ago

I tried passing arguments to admob.banner.prepare but it gives me a typescript error saying .prepare isn't expecting arguments. Any other solutions work for you guys?

manoharreddyporeddy commented 5 years ago

I solved and documented here:: https://github.com/manoharreddyporeddy/everyday-solutions/blob/master/display-ads-on-android-using-admob.js