Open abhishek-kumar97 opened 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, })
.
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?
I solved and documented here:: https://github.com/manoharreddyporeddy/everyday-solutions/blob/master/display-ads-on-android-using-admob.js
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