53 private readonly IBannerClient _client;
65 this._client = YandexMobileAdsClientFactory.BuildBannerClient(blockId, adSize, position);
67 MainThreadDispatcher.initialize();
68 ConfigureBannerEvents();
77 _client.LoadAd(_adRequestFactory.CreateAdRequest(request));
104 private void ConfigureBannerEvents()
106 this._client.OnAdLoaded += (sender, args) =>
108 if (this.OnAdLoaded ==
null)
113 MainThreadDispatcher.EnqueueAction(() =>
115 if (this.OnAdLoaded ==
null)
124 this._client.OnAdFailedToLoad += (sender, args) =>
126 if (this.OnAdFailedToLoad ==
null)
131 MainThreadDispatcher.EnqueueAction(() =>
133 if (this.OnAdFailedToLoad ==
null)
142 this._client.OnReturnedToApplication += (sender, args) =>
144 if (this.OnReturnedToApplication ==
null)
149 MainThreadDispatcher.EnqueueAction(() =>
151 if (this.OnReturnedToApplication ==
null)
160 this._client.OnLeftApplication += (sender, args) =>
162 if (this.OnLeftApplication ==
null)
167 MainThreadDispatcher.EnqueueAction(() =>
169 if (this.OnLeftApplication ==
null)
178 this._client.OnAdClicked += (sender, args) =>
180 if (this.OnAdClicked ==
null)
185 MainThreadDispatcher.EnqueueAction(() =>
187 if (this.OnAdClicked ==
null)
196 this._client.OnImpression += (sender, args) =>
198 if (this.OnImpression ==
null)
203 MainThreadDispatcher.EnqueueAction(() =>
205 if (this.OnImpression ==
null)
Banner(string blockId, BannerAdSize adSize, AdPosition position)
Initializes an object of the Banner class to display the banner with the specified size.