// Creates a BannerView and adds it to the view hierarchy.
        public BannerView(string adUnitId, AdSize adSize, AdPosition position)
        {
            client = GoogleMobileAdsClientFactory.BuildBannerClient();
            client.CreateBannerView(adUnitId, adSize, position);

            client.OnAdLoaded += delegate(object sender, EventArgs args)
            {
                OnAdLoaded(this, args);
            };

            client.OnAdFailedToLoad += delegate(object sender, AdFailedToLoadEventArgs args)
            {
                OnAdFailedToLoad(this, args);
            };

            client.OnAdOpening += delegate(object sender, EventArgs args)
            {
                OnAdOpening(this, args);
            };

            client.OnAdClosed += delegate(object sender, EventArgs args)
            {
                OnAdClosed(this, args);
            };

            client.OnAdLeavingApplication += delegate(object sender, EventArgs args)
            {
                OnAdLeavingApplication(this, args);
            };
        }
Esempio n. 2
0
        // Creates a BannerView with a custom position.
        public BannerView(string adUnitId, AdSize adSize, int x, int y)
        {
            client = GoogleMobileAdsClientFactory.BuildBannerClient();
            client.CreateBannerView(adUnitId, adSize, x, y);

            configureBannerEvents();
        }
        // Creates a BannerView with a custom position.
        public BannerView(string adUnitId, AdSize adSize, int x, int y)
        {
            this.client = MobileAds.GetClientFactory().BuildBannerClient();
            client.CreateBannerView(adUnitId, adSize, x, y);

            ConfigureBannerEvents();
        }
Esempio n. 4
0
        // Creates a BannerView and adds it to the view hierarchy.
        public BannerView(string adUnitId, AdSize adSize, AdPosition position)
        {
            client = GoogleMobileAdsClientFactory.BuildBannerClient();
            client.CreateBannerView(adUnitId, adSize, position);

            configureBannerEvents();
        }
        // Creates a BannerView and adds it to the view hierarchy.
        public BannerView(string adUnitId, AdSize adSize, AdPosition position)
        {
            this.client = MobileAds.GetClientFactory().BuildBannerClient();
            client.CreateBannerView(adUnitId, adSize, position);

            ConfigureBannerEvents();
        }
Esempio n. 6
0
        // Creates a BannerView and adds it to the view hierarchy.
        public BannerView(string adUnitId, AdSize adSize, AdPosition position)
        {
            client = GoogleMobileAdsClientFactory.BuildBannerClient();
            client.CreateBannerView(adUnitId, adSize, position);

            client.OnAdLoaded += delegate(object sender, EventArgs args)
            {
                OnAdLoaded(this, args);
            };

            client.OnAdFailedToLoad += delegate(object sender, AdFailedToLoadEventArgs args)
            {
                OnAdFailedToLoad(this, args);
            };

            client.OnAdOpening += delegate(object sender, EventArgs args)
            {
                OnAdOpening(this, args);
            };

            client.OnAdClosed += delegate(object sender, EventArgs args)
            {
                OnAdClosed(this, args);
            };

            client.OnAdLeavingApplication += delegate(object sender, EventArgs args)
            {
                OnAdLeavingApplication(this, args);
            };
        }
Esempio n. 7
0
        public BannerView(string adUnitId, AdSize adSize, int x, int y)
        {
            Type       type   = Type.GetType("GoogleMobileAds.GoogleMobileAdsClientFactory,Assembly-CSharp");
            MethodInfo method = type.GetMethod("BuildBannerClient", BindingFlags.Static | BindingFlags.Public);

            client = (IBannerClient)method.Invoke(null, null);
            client.CreateBannerView(adUnitId, adSize, x, y);
            ConfigureBannerEvents();
        }
Esempio n. 8
0
        // Creates a BannerView and adds it to the view hierarchy.
        public BannerView(string adUnitId, AdSize adSize, AdPosition position)
        {
            Type googleMobileAdsClientFactory = Type.GetType(
                "GoogleMobileAds.GoogleMobileAdsClientFactory,AdMob");
            MethodInfo method = googleMobileAdsClientFactory.GetMethod(
                "BuildBannerClient",
                BindingFlags.Static | BindingFlags.Public);

            this.client = (IBannerClient)method.Invoke(null, null);
            client.CreateBannerView(adUnitId, adSize, position);

            ConfigureBannerEvents();
        }
Esempio n. 9
0
        // Creates a BannerView and adds it to the view hierarchy.
        public BannerView(string adUnitId, AdSize adSize, AdPosition position)
        {
            client = GoogleMobileAdsClientFactory.BuildBannerClient();
            client.CreateBannerView(adUnitId, adSize, position);

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

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

            this.client.OnAdOpening += (sender, args) =>
            {
                if (this.OnAdOpening != null)
                {
                    this.OnAdOpening(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);
                }
            };
        }
Esempio n. 10
0
 public BannerView(string adAppId, string adUnitId, BannerViewOptions options)
 {
     bannerClient = AtmosplayAdsClientFactory.BuildBannerClient();
     bannerClient.CreateBannerView(adAppId, adUnitId, options);
     ConfigureBannerEvents();
 }