ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
499 stars 214 forks source link

In IOS, showAd (false), it makes the banner goes blank, instead of disappearing #15

Closed warcry2000 closed 7 years ago

warcry2000 commented 7 years ago

Hello,

In IOS when i used showAd(false) to hide the banner, it makes the banner goes blank, instead of disappearing.

This did not happen before. In version 1.0.5 working properly.

Many thank for work

warcry2000 commented 7 years ago

Does not happen every time, sometimes yes, sometimes no

gfismtposb commented 7 years ago

i have the same problem, do you have any solution? regards!!!

vintage commented 7 years ago

Have you observed any pattern in making the space blank? I've been playing with it for few minutes, couldn't reproduce the issue using latest version of the library. And what does the "blank" mean? The banner becomes some "gray box" and still occupy the screen?

warcry2000 commented 7 years ago

Hello, this happens when I show and hidden the banner. I do this in my application depending on the screen that the user visits. Hiding the banner there are times when the banner is removed but the space it occupied is left White. Then on the screen that part of the banner remains white. It is not disappear banner area.

This occurs in ipad.

Regards!!!

vintage commented 7 years ago

What options are you using to initialize the plugin? Can you paste your initialization code here?

https://github.com/ratson/cordova-plugin-admob-free#3-set-options

warcry2000 commented 7 years ago

Helo, this:

AdMob.createBannerView( { publisherId: this.idBanner, bannerAtTop: false, overlap: false, offsetTopBar: false, autoShow : true } );

vintage commented 7 years ago

I didn't even know that you can pass options to the createBannerView instead of the setOptions, but after looking at the source code seems correct. Have you tried to first initialize the library:

AdMob.setOptions({
  publisherId: this.idBanner,
  bannerAtTop: false,
  overlap: false,
  offsetTopBar: false,
  isTesting: false,
  autoShow: true,
});

And after that calling the: AdMob.createBannerView();? Then once you navigate through pages call AdMob. showAd(true) or AdMob. showAd(false). I can't say if it changes anything, but that's the way which I've used in my project. Additionally you can make a test and check if wrapping the code into setTimeout do the trick like:

setTimeout(function() { AdMob.showAd(true);}, 2000);

Are you using any framework for the app? Ionic for example?

warcry2000 commented 7 years ago

It will try to initialize.

I am using ionicframework.

If I tried to show and hide and with: setTimeout (function () {AdMob.showAd (true);}, 2000); Even hide several times if the second work.

I feel that because of the method

thank you very much for your concern.

vintage commented 7 years ago

Yes, it seems more than issue with the Ionic Framework than the AdMob library itself. I'm using the lib with the Ionic 2 and didn't have any problems at all, so it's probably related only to the Ionic 1. I'm not familiar with the Ionic 1, so I think better place to get help on this issue is to go directly to their issue tracker. Hope you will find solution for this!

warcry2000 commented 7 years ago

Hello thank you very much.

I tried it with 'setOptions' and neither is arranged.

When testing with an iPad 2 running, but with ipad 1 does not work.

I is that I'm not familiar with ionic 2, so do not know if it will be to use ionic 1.

I keep trying to see if I can find solution.

ratson commented 7 years ago

I am closing this since v0.6 provides new set APIs.