public void OnAdEvent(IAdEvent ad_event) { System.Diagnostics.Debug.WriteLine("Event: " + ad_event.Type); // These are the suggested event types to handle. For full list of all ad event // types, see the documentation for AdEvent.AdEventType. if (ad_event.Type == AdEventAdEventType.Loaded) { if (AndroidAds.AdsManager != null) { this.IsAdPaused = false; AndroidAds.AdsManager.Start(); this.State = AdState.Playing; } } else if (ad_event.Type == AdEventAdEventType.Paused) { this.IsAdPaused = true; } else if (ad_event.Type == AdEventAdEventType.Resumed) { this.IsAdPaused = false; } else if (ad_event.Type == AdEventAdEventType.AllAdsCompleted) { // If the ads are done playing destroy the AdsManager and set the state to Done this.Finish(); } }
public Advertisement(IAdEvent adEvent, IAdListener listener) { this.adEvent = adEvent; this.adCallbacks = new AdCallbacks( (error) => listener.OnError(error), () => listener.OnStarted(), () => listener.OnCompleted(), () => listener.OnClosed(), () => listener.OnInterstitialClicked(), (reward, count) => listener.OnRewardPending(reward, count), () => listener.OnRewardedVideoStarted(), () => listener.OnRewardedVideoEnded()); }
public Advertisement(IAdEvent adEvent, AdCallbacks adCallbacks) { this.adEvent = adEvent; this.adCallbacks = adCallbacks; }
public void OnAdEvent(IAdEvent ad_event) { this.AndroidAds.OnAdEvent(ad_event); }