Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 571
Eduardo Albuquerque Avatar asked Sep 03 '18 03:09

Eduardo Albuquerque


2 Answers

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 =)

like image 129
Eduardo Albuquerque Avatar answered Oct 16 '22 09:10

Eduardo Albuquerque


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

like image 21
suzan Avatar answered Oct 16 '22 07:10

suzan