Esempio n. 1
0
 public IADHandlerProxy(IADHandler handler) : base(WHANDLER_ID)
 {
     adNotFound  = handler.OnAdNotFound;
     adFound     = handler.OnAdFound;
     adClosed    = handler.OnAdClosed;
     adError     = handler.OnAdError;
     adDisplayed = handler.OnAdDisplayed;
 }
        public void InitAd()
        {
            _interstitialAd = new InterstitialAd(CrossCurrentActivity.Current.Activity);
            //       _interstitialAd.AdUnitId = App.InterstitialAndroidId;
            var adListener = new AdMobAdListener();

            adListener.AdClosed += () =>
            {
                AdClosed?.Invoke();

                _interstitialAd.Dispose();
                _interstitialAd = null;
            };
            adListener.AdLoaded += () =>
            {
                AdReady?.Invoke();
            };
            _interstitialAd.AdListener = adListener;
        }
 public override void OnAdClosed()
 {
     base.OnAdClosed();
     AdClosed?.Invoke();
 }
Esempio n. 4
0
 public IADHandlerProxy(IADHandler handler)
     : base(WHANDLER_ID)
 {
     adNotFound = handler.OnAdNotFound;
     adFound = handler.OnAdFound;
     adClosed = handler.OnAdClosed;
     adError = handler.OnAdError;
     adDisplayed = handler.OnAdDisplayed;
 }
 public override void OnAdClosed()
 {
     base.OnAdClosed();
     AdClosed?.Invoke(_adUnit, null);
     Console.WriteLine($"OnAdClosed({_adUnit})");
 }
Esempio n. 6
0
 public override void OnAdClosed()
 {
     base.OnAdClosed();
     AdClosed?.Invoke(null, null);
     Console.WriteLine("OnAdClosed");
 }