I have tried everything, but can’t get admob free to render a banner in my Ionic 4 app.
Notes:
- Test ads are showing fine in both Android and iOS with isTesting = true. Great.
- Google test bannerAdId works with the code as below (isTesting = false): ca-app-pub-3940256099942544/6300978111
- Information in AdMob account is all filled in including payment method + address.
- The app is not in the store yet, I wanted to check the ads work with their respective Ids first.
- Swapping out isTesting for the ad Id causes:
- Android: no banner at all
- iOS: black bar where banner should be
Here’s how I’m showing the ad, being called in app.component.ts:
this.platform.ready().then(() => {
this.showBannerAd();
});
Ad setup code (yes, each of my bannerId strings are definitely correct):
showBannerAd() {
this._AdmobFree.banner.config(<AdMobFreeBannerConfig> {
id: (this._UIService.isAndroid()) ?
this._ConfigurationService.googleAdMob_bannerId_android :
this._ConfigurationService.googleAdMob_bannerId_ios,
isTesting: false,
autoShow: false
});
this._AdmobFree.banner.prepare();
try {
this._AdmobFree.banner.show().catch(e => {
this._EmailService.sendLogEmail(<Log> {
error: JSON.stringify(e)
});
})
}
catch(e) {}
}
Anyone had this problem before - maybe it’s something up with my AdMob account details?