// 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);
            };
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The class constructor.
        /// <param name="blockId"> Unique ad placement ID created at partner interface. Example: R-M-DEMO-320x50.</param>
        /// <param name="adSize"> The size of banner ad. <see cref="YandexMobileAds.Base.AdSize"/></param>
        /// <param name="position"> Banner position on screen <see cref="YandexMobileAds.Base.AdPosition"/></param>
        /// </summary>
        public Banner(string blockId, AdSize adSize, AdPosition position)
        {
            this.adRequestFactory = new AdRequestCreator();
            this.client           = YandexMobileAdsClientFactory.BuildBannerClient(blockId, adSize, position);

            ConfigureBannerEvents();
        }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
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();
        }
Ejemplo n.º 5
0
        // 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();
        }
Ejemplo n.º 6
0
        // 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();
        }
Ejemplo n.º 7
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);
            };
        }
Ejemplo n.º 8
0
        public BannerView(string adUnitId, AdSize adSize, int x, int y)
        {
            MethodInfo method = Type.GetType("GoogleMobileAds.GoogleMobileAdsClientFactory,Assembly-CSharp").GetMethod("BuildBannerClient", BindingFlags.Public | BindingFlags.Static);

            this.client = (IBannerClient)method.Invoke(null, null);
            this.client.CreateBannerView(adUnitId, adSize, x, y);
            this.ConfigureBannerEvents();
        }
Ejemplo n.º 9
0
        public BannerView(string adUnitId, AdSize adSize, AdPosition position)
        {
            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, position);
            ConfigureBannerEvents();
        }
Ejemplo n.º 10
0
 public IBannerClient getBannerClient()
 {
     if (bannerClient == null)
     {
         bannerClient = PlatformClientFactory.GetBannerClient();
         bannerClient.CreateBanner(AdPosition.BottomPortrait);
         bannerClient.LoadAd();
     }
     return(bannerClient);
 }
Ejemplo n.º 11
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);
                }
            };
        }
Ejemplo n.º 12
0
 public BannerView(string adAppId, string adUnitId, BannerViewOptions options)
 {
     bannerClient = AtmosplayAdsClientFactory.BuildBannerClient();
     bannerClient.CreateBannerView(adAppId, adUnitId, options);
     ConfigureBannerEvents();
 }