I want to test add mob ionic 4 application. trying this code and is not showing anything when run on android device.
Trying to test show banner Ads in my app
Installed these plugin and npm module. ionic cordova plugin add cordova-plugin-admob-free npm install @ionic-native/admob-free
This is my versions ionic -v 5.2.3 node -v v10.16.0 npm -v 6.9.0
Calling show showAdmobBannerAds() function inside constructor.
constructor(private platform: Platform,private admobFree: AdMobFree) {
this.platform.ready().then(() => {
this.showAdmobBannerAds()
});
}
this is my add mob configuration and function.
showAdmobBannerAds(){
const bannerConfig: AdMobFreeBannerConfig = {
id: "ca-app-pub-XXXXXX",
isTesting: true,
autoShow: true
};
this.admobFree.banner.config(bannerConfig);
this.admobFree.banner.prepare().then(() => {
console.log('inside add show');
})
.catch(e => console.log(e));
}
Expected to show banner add.