/// <summary> /// Load banner ad /// </summary> /// <param name="view">container object</param> public void LoadBannerAdView(object view) { //if(banner == null) try { banner = (AdView)view; if (string.IsNullOrEmpty(banner.AdUnitId)) { return; } banner.LoadAd(new AdRequest.Builder().Build()); banner.AdListener = new BannerListener(this); AdUnitIdBanner = banner.AdUnitId; banner.RefreshDrawableState(); } catch (Exception ex) { throw new Exception("Google.Ads.Android.cs => LoadBannerAdView", ex); } }
/// <summary> /// Refresh ad information with a new one /// </summary> public void RefreshBannerAdView() { if (banner != null) { banner.RefreshDrawableState(); } }