when i'll try run my application in my device with this code:
ionic cordova build android
It is generated an APK and I installed in my device. When i build with this code, the Ads works:
showAd() {
const bannerConfig: AdMobFreeBannerConfig = {
isTesting: true,
autoShow: true
};
this.admobFree.banner.config(bannerConfig);
this.admobFree.banner.prepare()
.then(() => {
// banner Ad is ready
// if we set autoShow to false, then we will need to call the show method here
})
.catch(e => console.log(e));
}
When I build with this other code, the Ads not show:
showAd() {
const bannerConfig: AdMobFreeBannerConfig = {
id: 'MY-ID-FROM-ADMOB',
isTesting: false,
autoShow: true
};
this.admobFree.banner.config(bannerConfig);
this.admobFree.banner.prepare()
.then(() => {
// banner Ad is ready
// if we set autoShow to false, then we will need to call the show method here
})
.catch(e => console.log(e));
}
Someone help me, please...
Sorry if I wrote wrong something, my english is not very well...
thanks suzan for share but it is not the solution. After 3 days I finally succeed publishing my app with ads.
I searched many solution, and in this post: ionic-3-admob-free-not-displaying-ads-when-testing-is-false Says that i needed to added my address on the payment page.
In the cordova-plugin-admob-free site, i read that i needed added this code in my config.xml:
<plugin name="cordova-admob-sdk" spec="~0.13.1">
<variable name="PLAY_SERVICES_VERSION" value="11.6.0" />
</plugin>
I tested with this adID: ca-app-pub-3940256099942544/6300978111, this adId is found in google test Ads site, and worked!
When I was test with my adId showed a black rectangle istead of the Ads, i ignore it, because in google Admob FAQ says: When new apps are registered with AdMob,may taken a time for working. (summarizing)
When I published in Play store, the Ads are showing!!
Thanks for all =)
Well, it takes a while to display ads using the new adMob ad-ID.
And you should remove the isTesting
from the admob config.
showAd() {
const bannerConfig: AdMobFreeBannerConfig = {
id: 'MY-ID-FROM-ADMOB',
autoShow: true
};
this.admobFree.banner.config(bannerConfig);
this.admobFree.banner.prepare()
.then(() => {
// banner Ad is ready
})
.catch(e => console.log(e));
}
It may take certain days or a day
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With