예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #3
0
 public override void OnPause()
 {
     try
     {
         base.OnPause();
         PublisherAdView?.Pause();
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
 public override void OnPause()
 {
     try
     {
         base.OnPause();
         PublisherAdView?.Pause();
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
예제 #5
0
 protected override void OnPause()
 {
     try
     {
         base.OnPause();
         AddOrRemoveEvent(false);
         PublisherAdView?.Pause();
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
 protected override void OnPause()
 {
     try
     {
         base.OnPause();
         AddOrRemoveEvent(false);
         PublisherAdView?.Pause();
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }