コード例 #1
0
        public static void Ad_Interstitial(Activity context)
        {
            try
            {
                if (AppSettings.ShowAdMobInterstitial)
                {
                    if (CountInterstitial == AppSettings.ShowAdMobInterstitialCount)
                    {
                        CountInterstitial = 0;
                        AdMobInterstitial ads = new AdMobInterstitial();
                        ads.ShowAd(context);
                    }
                    else
                    {
                        AdsFacebook.InitInterstitial(context);
                    }

                    CountInterstitial++;
                }
                else
                {
                    AdsFacebook.InitInterstitial(context);
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
コード例 #2
0
        public static AdMobRewardedVideo Ad_RewardedVideo(Activity context)
        {
            try
            {
                if (AppSettings.ShowAdMobRewardVideo)
                {
                    if (CountRewarded == AppSettings.ShowAdMobRewardedVideoCount)
                    {
                        CountRewarded = 0;
                        AdMobRewardedVideo ads = new AdMobRewardedVideo();
                        ads.ShowAd(context);
                        return(ads);
                    }
                    else
                    {
                        AdsFacebook.InitRewardVideo(context);
                    }

                    CountRewarded++;
                }
                else
                {
                    AdsFacebook.InitRewardVideo(context);
                }
                return(null);
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
                return(null);
            }
        }