marcojak / MTAdmob

Admob plugin for Xamarin Android and iOS
https://www.xamarinexpert.it/admob-made-easy/
160 stars 26 forks source link

How to show interstitials #10

Closed K232 closed 4 years ago

K232 commented 4 years ago

HI Marco, to show interstitials there are 2 lines of code:

As seen in your sample, ShowInterstitial does not work as long as LoadInterstitial is not called and completed. So what would be the proposed usage within an app? Typically I just want to say "ShowInterstitial" and that's it, as shown in your linked blog post. But that's not working, as ShowInterstitial does not take any parameters anymore.

So what's the proposed way then?

Is that the best way to do it?

marcojak commented 4 years ago

Hi Kai,

Yes, you need to preload the Interstitial before showing it. When to show it then, it up to you. You can show it immediately when you receive the event OnInterstitialLoaded or you can preload it and then show it only when required.

You are correct about subscribe and unsubscribe, it's a good thing to do it when you load a page and when you leave it.

K232 commented 4 years ago

OK, thanks for clarification! 👍 Maybe it would bei a Feature Request to have that included in the package, in Addition to current Options? Something Like "ShowIfLoaded"? So i could load it, and wegen the User clicks a Button i could Show the interstitial If it is loaded?

marcojak commented 4 years ago

It's already there.

bool IsInterstitialLoaded();

this will tell you if the Interstitial is ready to be used

K232 commented 4 years ago

Many thanks Marco!