25 public event EventHandler<InterstitialAdLoadedEventArgs>
OnAdLoaded;
33 private readonly IInterstitialAdLoaderClient _client;
41 this._client = YandexMobileAdsClientFactory.BuildInterstitialAdLoaderClient();
43 MainThreadDispatcher.initialize();
44 ConfigureInterstitialEvents();
54 _client.LoadAd(_adRequestConfigurationFactory.CreateAdRequestConfiguration(configuration));
62 this._client.CancelLoading();
65 private void ConfigureInterstitialEvents()
67 this._client.OnAdLoaded += (sender, args) =>
69 if (this.OnAdLoaded ==
null)
74 MainThreadDispatcher.EnqueueAction(() =>
76 if (this.OnAdLoaded ==
null)
81 InterstitialAdLoadedEventArgs adLoadedEventArgs =
new InterstitialAdLoadedEventArgs()
89 this._client.OnAdFailedToLoad += (sender, args) =>
91 if (this.OnAdLoaded ==
null)
96 MainThreadDispatcher.EnqueueAction(() =>
98 if (this.OnAdLoaded ==
null)