Beispiel #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)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
Beispiel #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)
            {
                Methods.DisplayReportResultTrack(exception);
                return(null !);
            }
        }
        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);
            }
        }
        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);
            }
        }
Beispiel #5
0
        public static AdMobRewardedInterstitial Ad_RewardedInterstitial(Activity context)
        {
            try
            {
                switch (AppSettings.ShowAdMobRewardedInterstitial)
                {
                case true when CountRewardedInterstitial == AppSettings.ShowAdMobRewardedInterstitialCount:
                {
                    CountRewardedInterstitial = 0;
                    AdMobRewardedInterstitial ads = new AdMobRewardedInterstitial();
                    ads.ShowAd(context);
                    return(ads);
                }

                case true:
                    AdsFacebook.InitRewardVideo(context);
                    break;

                default:
                    AdsFacebook.InitRewardVideo(context);
                    break;
                }

                return(null !);
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
                return(null !);
            }
        }
Beispiel #6
0
        public static void Ad_AppOpenManager(Activity context)
        {
            try
            {
                switch (AppSettings.ShowAdMobAppOpen)
                {
                case true:
                {
                    if (CountAppOpen == AppSettings.ShowAdMobAppOpenCount)
                    {
                        CountAppOpen = 0;

                        AppOpenManager appOpenManager = new AppOpenManager(context);
                        appOpenManager.ShowAdIfAvailable();
                    }
                    else
                    {
                        AdsFacebook.InitInterstitial(context);
                    }

                    CountAppOpen++;
                    break;
                }

                default:
                    AdsFacebook.InitInterstitial(context);
                    break;
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }