Example #1
0
        public static void InitPublisherAdView(PublisherAdView mAdView)
        {
            try
            {
                if (mAdView == null)
                {
                    return;
                }

                if (AppSettings.ShowAdMobBanner)
                {
                    mAdView.Visibility = ViewStates.Visible;
                    var adRequest = new PublisherAdRequest.Builder();
                    adRequest.AddTestDevice(UserDetails.AndroidId);
                    mAdView.AdListener = new MyPublisherAdViewListener(mAdView);
                    mAdView.LoadAd(adRequest.Build());
                }
                else
                {
                    mAdView.Pause();
                    mAdView.Visibility = ViewStates.Gone;
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Example #2
0
        public static void InitPublisherAdView(PublisherAdView mAdView)
        {
            try
            {
                switch (mAdView)
                {
                case null:
                    return;
                }

                switch (AppSettings.ShowAdMobBanner)
                {
                case true:
                {
                    mAdView.Visibility = ViewStates.Visible;
                    var adRequest = new PublisherAdRequest.Builder();
#pragma warning disable 618
                    adRequest.AddTestDevice(UserDetails.AndroidId);
#pragma warning restore 618
                    mAdView.AdListener = new MyPublisherAdViewListener(mAdView);
                    mAdView.LoadAd(adRequest.Build());
                    break;
                }

                default:
                    mAdView.Pause();
                    mAdView.Visibility = ViewStates.Gone;
                    break;
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }