Search code examples
ionic-frameworkionic3admobcordova-plugins

The banner not showing with my id from adMob Ionic 3


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...


Solution

  • thanks suzan for share but it is not the solution. After 3 days I finally succeed publishing my app with ads.

    1. 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.

    2. 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>

    1. I tested with this adID: ca-app-pub-3940256099942544/6300978111, this adId is found in google test Ads site, and worked!

    2. 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)

    3. When I published in Play store, the Ads are showing!!

    Thanks for all =)