private static IMobileAdsClient GetMobileAdsClient()
 {
     return(GoogleMobileAdsClientFactory.MobileAdsInstance());
 }
        // Creates a Singleton RewardBasedVideoAd.
        private RewardBasedVideoAd()
        {
            client = GoogleMobileAdsClientFactory.BuildRewardBasedVideoAdClient();
            client.CreateRewardBasedVideoAd();

            this.client.OnAdLoaded += (sender, args) =>
            {
                if (this.OnAdLoaded != null)
                {
                    this.OnAdLoaded(this, args);
                }
            };

            this.client.OnAdFailedToLoad += (sender, args) =>
            {
                if (this.OnAdFailedToLoad != null)
                {
                    this.OnAdFailedToLoad(this, args);
                }
            };

            this.client.OnAdOpening += (sender, args) =>
            {
                if (this.OnAdOpening != null)
                {
                    this.OnAdOpening(this, args);
                }
            };

            this.client.OnAdStarted += (sender, args) =>
            {
                if (this.OnAdStarted != null)
                {
                    this.OnAdStarted(this, args);
                }
            };

            this.client.OnAdClosed += (sender, args) =>
            {
                if (this.OnAdClosed != null)
                {
                    this.OnAdClosed(this, args);
                }
            };

            this.client.OnAdLeavingApplication += (sender, args) =>
            {
                if (this.OnAdLeavingApplication != null)
                {
                    this.OnAdLeavingApplication(this, args);
                }
            };

            this.client.OnAdRewarded += (sender, args) =>
            {
                if (this.OnAdRewarded != null)
                {
                    this.OnAdRewarded(this, args);
                }
            };
        }
示例#3
0
 // Token: 0x06000246 RID: 582 RVA: 0x0000D7EB File Offset: 0x0000BBEB
 public BannerView(string adUnitId, AdSize adSize, AdPosition position)
 {
     this.client = GoogleMobileAdsClientFactory.BuildBannerClient();
     this.client.CreateBannerView(adUnitId, adSize, position);
     this.configureBannerEvents();
 }
示例#4
0
 // Token: 0x06000247 RID: 583 RVA: 0x0000D812 File Offset: 0x0000BC12
 public BannerView(string adUnitId, AdSize adSize, int x, int y)
 {
     this.client = GoogleMobileAdsClientFactory.BuildBannerClient();
     this.client.CreateBannerView(adUnitId, adSize, x, y);
     this.configureBannerEvents();
 }
 // Creates an InsterstitialAd.
 public InterstitialAd(string adUnitId)
 {
     client = GoogleMobileAdsClientFactory.GetGoogleMobileAdsInterstitialClient(this);
     client.CreateInterstitialAd(adUnitId);
 }
示例#6
0
 // Create a BannerView and add it into the view hierarchy.
 public BannerView(string adUnitId, AdSize adSize, AdPosition position)
 {
     client = GoogleMobileAdsClientFactory.GetGoogleMobileAdsBannerClient(this);
     client.CreateBannerView(adUnitId, adSize, position);
 }