Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-load banner, show on request. #36

Open
LeXXik opened this issue Mar 23, 2020 · 2 comments
Open

Pre-load banner, show on request. #36

LeXXik opened this issue Mar 23, 2020 · 2 comments

Comments

@LeXXik
Copy link

LeXXik commented Mar 23, 2020

Is there a way to load the banner, without showing it?

Here is my issue: One of the views of my app has a banner. I show it with AdMob.showBanner(options). However, if the user navigates away from the view quickly enough, the banner shows up in another view, where it is not supposed to.

I assume that after calling .showBanner(), the module sends request for an ad and then displays it as soon as it loads. However, the view might already navigate away at that point. Is there a way to load the banner, without showing it? Similar to .prepareRewardVideoAd() and .showRewardVideoAd().

@rahadur
Copy link
Owner

rahadur commented Apr 20, 2020

Banner AD has method to show and hide did you check it.?

https://github.com/rahadur/capacitor-admob#resumebanner-promise-value-boolean-

@LeXXik
Copy link
Author

LeXXik commented Apr 20, 2020

Hello, @rahadur

Thank you, for the suggestion. I do use hide and show methods to control the banner display between different views. They work well for their purpose, however my issue is different.

I probably didn't explain my issue clearly, for which I apologize. The hide method works well if the banner is loaded, but not during the very first call of .showBanner(). Here is a pseudo sequence as an example. Lets say a banner should be seen in view A, but not in view B.

  • View A is opened
  • AdMob.showBanner(options)
  • User clicks a button to open view B
  • View B is opened
  • AdMob.hideBanner()
  • Banner loads and shows on screen

The hide method doesn't work in this scenario, since the banner is not loaded yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants