public void Show() { //var context = Android.App.Application.Context; Android.Gms.Ads.InterstitialAd ad = new Android.Gms.Ads.InterstitialAd(context); ad.AdUnitId = "ca-app-pub-4681470946279796/3704231820"; _ad = ad; OnAdLoaded(); ad.AdListener = this; var requestbuilder = new AdRequest.Builder(); ad.LoadAd(requestbuilder.Build()); }
public void show() { var context = Application.Context; _ad = new InterstitialAd(context); _ad.AdUnitId = "ca-app-pub-9122365822495930/4770566486"; // Bloc d'annonce INTERSTITIEL ! var intlistener = new InterstitialAdListener(_ad); _ad.AdListener = intlistener; intlistener.OnAdLoaded(); var requestbuilder = new AdRequest.Builder(); _ad.LoadAd(requestbuilder.Build()); }
public Task LoadAd() { return(Thread.UI.Run(() => { if (string.IsNullOrEmpty(UnitId)) { OnAdFailed.Raise("The UnitId of the Interstitial ad has not specified!"); return; } interstitialAd = new Ads.InterstitialAd(UIRuntime.CurrentActivity); interstitialAd.AdUnitId = UnitId; interstitialAd.AdListener = new AndroidAdListener(this); interstitialAd.LoadAd(new Ads.AdRequest.Builder().Build()); })); }