sunnycupertino / cordova-plugin-admob-simple

Cordova plugin allowing Admob interstitials and banner ads.
MIT License
164 stars 150 forks source link

Show and hide Ads for specific pages #2

Closed DipakMahapurkar closed 8 years ago

DipakMahapurkar commented 8 years ago

Hello @sunnycupertino, I want to hide ads for some pages like login page, introduction page, about us page and also show ads for specific pages in ionic framework. How to resolve this issue. Thank You!!

sunnycupertino commented 8 years ago

Hi

Assuming you added the relevant functions to the javascript as explained in the readme, and called initAd() from onDeviceReady(), then:

showBannerFunc() - to show ads

window.plugins.AdMob.destroyBannerView(); - to hide ads

Call the above on the relevant page load events.

DipakMahapurkar commented 8 years ago

Thank for reply, I used those function in my code after loading the controller i will call window.plugins.AdMob.destroyBannerView(); then return back to previous view it will doesn't show me banner.

sunnycupertino commented 8 years ago

When you return back to the previous view do you call showBannerFunc() and then wait for it to load?

sunnycupertino commented 8 years ago

So did it work? Can I close this issue?