// 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); }; }
/// <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(); }
// 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 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(); }
// 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(); }
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(); }
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(); }
public IBannerClient getBannerClient() { if (bannerClient == null) { bannerClient = PlatformClientFactory.GetBannerClient(); bannerClient.CreateBanner(AdPosition.BottomPortrait); bannerClient.LoadAd(); } return(bannerClient); }
// 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); } }; }
public BannerView(string adAppId, string adUnitId, BannerViewOptions options) { bannerClient = AtmosplayAdsClientFactory.BuildBannerClient(); bannerClient.CreateBannerView(adAppId, adUnitId, options); ConfigureBannerEvents(); }