Ejemplo n.º 1
0
    public int returnToMainMenuCounter = 1; //Start at 1 to give the user 5 playthroughs before an ad.

    public void init()
    {
        string appKey = "17439d477eae29f7eb218efb949d88287d3388adb2fcbacd";

        if (Debug.isDebugBuild)
        {
            Appodeal.setTesting(true);
            //Appodeal.setLogging(true);
        }

        Appodeal.disableNetwork("amazon_ads");
        Appodeal.disableNetwork("smaato");
        Appodeal.disableNetwork("mailru");
        Appodeal.disableNetwork("vungle");
        Appodeal.disableNetwork("facebook");
        Appodeal.disableNetwork("startapp");
        Appodeal.disableNetwork("yandex");
        Appodeal.disableNetwork("tapjoy");
        Appodeal.disableNetwork("inner-active");
        Appodeal.disableNetwork("cheetah");
        Appodeal.disableLocationPermissionCheck();
        Appodeal.cache(Appodeal.REWARDED_VIDEO);
        Appodeal.initialize(appKey, Appodeal.BANNER | Appodeal.INTERSTITIAL | Appodeal.REWARDED_VIDEO | Appodeal.NON_SKIPPABLE_VIDEO);

        Appodeal.setInterstitialCallbacks(this);
        Appodeal.setRewardedVideoCallbacks(this);
    }
Ejemplo n.º 2
0
 private void InitializeAdvertisment(bool isTesting)
 {
     Appodeal.setTesting(isTesting);
     Appodeal.disableLocationPermissionCheck();
     Appodeal.disableWriteExternalStoragePermissionCheck();
     Appodeal.initialize(API_KEY, Appodeal.REWARDED_VIDEO);
 }
Ejemplo n.º 3
0
 private void Start()
 {
     Appodeal.initialize(AppKey, ADTypes, true);
     Appodeal.setInterstitialCallbacks(this);
     Appodeal.setBannerCallbacks(this);
     Appodeal.setRewardedVideoCallbacks(this);
 }
Ejemplo n.º 4
0
    void Start()
    {
        isRewardedVideoLoaded = false;
        if (store == Stores.Amazon)
        {
            thisStore = AmazonAppKey;
        }
        else
        {
            thisStore = GooglePlayAppKey;
        }

        if (PlayerPrefs.GetInt("result_gdpr", 0) != 0)
        {
            consentValue = PlayerPrefs.GetInt("result_gdpr_sdk") > 0 ? true : false;
            Debug.Log(consentValue);
            Appodeal.initialize(thisStore, Appodeal.REWARDED_VIDEO, consentValue);
        }
        else
        {
            Appodeal.initialize(thisStore, Appodeal.REWARDED_VIDEO, false);
            ShowConscentWindow();
        }
        Appodeal.setRewardedVideoCallbacks(this);
        Appodeal.setLogLevel(Appodeal.LogLevel.Verbose);

//Testing Mode
        Appodeal.setTesting(false);
    }
Ejemplo n.º 5
0
    public void Init()
    {
        Appodeal.disableWriteExternalStoragePermissionCheck();

        //Example for UserSettings usage
        UserSettings settings = new UserSettings();

        settings.setAge(25).setGender(UserSettings.Gender.OTHER);


        //if (LoggingToggle.isOn) Appodeal.setLogging(true);
        //if (TestingToggle.isOn)
        Appodeal.setTesting(true);

        //Appodeal.setSmartBanners(false);
        Appodeal.setBannerAnimation(false);
        Appodeal.setBannerBackground(false);

        Appodeal.initialize(appKey, Appodeal.INTERSTITIAL | Appodeal.BANNER | Appodeal.REWARDED_VIDEO);

        Appodeal.setBannerCallbacks(this);
        Appodeal.setInterstitialCallbacks(this);
        Appodeal.setRewardedVideoCallbacks(this);

        Appodeal.setCustomRule("newBoolean", true);
        Appodeal.setCustomRule("newInt", 1234567890);
        Appodeal.setCustomRule("newDouble", 123.123456789);
        Appodeal.setCustomRule("newString", "newStringFromSDK");
    }
Ejemplo n.º 6
0
 public void ShowImNonSkipable()
 {
     if (Appodeal.isLoaded(Appodeal.NON_SKIPPABLE_VIDEO))
     {
         Appodeal.show(Appodeal.NON_SKIPPABLE_VIDEO);
     }
 }
Ejemplo n.º 7
0
 public void ShowInterstitial()
 {
     if (Appodeal.isLoaded(Appodeal.INTERSTITIAL))
     {
         Appodeal.show(Appodeal.INTERSTITIAL);
     }
 }
    private void Update()
    {
        if (SoundMuted)
        {
            musicsource.mute = enabled;
        }
        else
        {
            musicsource.mute = !enabled;
        }


        if (Points > PlayerPrefs.GetInt("HighScore"))
        {
            PlayerPrefs.SetInt("HighScore", Points);
        }

        if (Appodeal.isLoaded(Appodeal.BANNER) && BannerLoaded == false && PlayerPrefs.GetInt("NoAds") != 1)
        {
            Appodeal.show(Appodeal.BANNER_BOTTOM);
            BannerLoaded = true;
        }

        if (TimesFailed >= 5)
        {
            if (Appodeal.isLoaded(Appodeal.INTERSTITIAL) && PlayerPrefs.GetInt("NoAds") != 1)
            {
                TimesFailed = 0;
                Appodeal.show(Appodeal.INTERSTITIAL);
            }
        }
    }
Ejemplo n.º 9
0
        /// <summary>
        /// Действия при получении правильного ответа
        /// </summary>
        /// <param name="skipQuestion">пропуск вопроса</param>
        private void CorrectAnswerAccepted(bool skipQuestion = false)
        {
            AnswerReceived?.Invoke();

            // Если не было пропуска, воспроизводим эффект
            if (skipQuestion == false)
            {
                _victory.Play();
            }

            // Выводим ответ и полное описание ответа
            _answer.text         = _tasksCountries.QuestionsHelpers.TaskItems[_tasksCountries.Progress - 1].FullAnswer;
            _detailedAnswer.text = _tasksCountries.QuestionsHelpers.TaskItems[_tasksCountries.Progress - 1].Description;

            IncreaseProgress(skipQuestion);

            if (Application.internetReachability != NetworkReachability.NotReachable)
            {
                // Каждый пятый уровень показываем рекламу
                if (PlayerPrefs.GetString("show-ads") == "yes" && _tasksCountries.Progress % 5 == 0)
                {
                    if (Appodeal.isLoaded(Appodeal.INTERSTITIAL))
                    {
                        Appodeal.show(Appodeal.INTERSTITIAL);
                    }
                }
            }
        }
Ejemplo n.º 10
0
    /// <summary>
    /// Runs Appodeal Ad of type.
    /// </summary>
    /// <param name="type"></param>
    public void RunAppodealAd(AdType type)
    {
        switch (type)
        {
        case Ads.AdType.Interstitial:
            if (Appodeal.isPrecache(Appodeal.INTERSTITIAL) || Appodeal.isLoaded(Appodeal.INTERSTITIAL))
            {
                Appodeal.show(Appodeal.INTERSTITIAL);
                Debug.Log("Running Interstitial ad.");
            }
            break;

        case Ads.AdType.Rewarded:
            if (Appodeal.isPrecache(Appodeal.REWARDED_VIDEO) || Appodeal.isLoaded(Appodeal.REWARDED_VIDEO))
            {
                Appodeal.show(Appodeal.REWARDED_VIDEO);
                Debug.Log("Running Rewarded Video ad.");
            }
            break;

        case Ads.AdType.Banner:
            if (Appodeal.isPrecache(Appodeal.BANNER) || Appodeal.isLoaded(Appodeal.BANNER))
            {
                Appodeal.show(Appodeal.BANNER_BOTTOM);
                Debug.Log("Running Banner ad.");
            }
            break;

        default:
            throw new System.NotImplementedException();
        }
    }
        public void OnNativeLoaded()
        {
            IList <INativeAd>   nativeAds    = Appodeal.GetNativeAds(1);
            NativeAdViewAppWall nativeAdView = FindViewById <NativeAdViewAppWall>(Resource.Id.native_ad_view_app_wall);

            nativeAdView.SetNativeAd(nativeAds[0]);
        }
Ejemplo n.º 12
0
    public void Init()
    {
        Appodeal.setLogLevel(loggingToggle ? Appodeal.LogLevel.Verbose : Appodeal.LogLevel.None);
        Appodeal.setTesting(testingToggle);
        Appodeal.setUserId("1");
        Appodeal.setUserAge(1);
        Appodeal.setUserGender(UserSettings.Gender.OTHER);
        Appodeal.disableLocationPermissionCheck();
        Appodeal.disableWriteExternalStoragePermissionCheck();
        Appodeal.setTriggerOnLoadedOnPrecache(Appodeal.INTERSTITIAL, true);
        Appodeal.setSmartBanners(true);
        Appodeal.setBannerAnimation(false);
        Appodeal.setTabletBanners(false);
        Appodeal.setBannerBackground(false);
        Appodeal.setChildDirectedTreatment(false);
        Appodeal.muteVideosIfCallsMuted(true);
        Appodeal.setAutoCache(Appodeal.INTERSTITIAL, false);
        Appodeal.setExtraData(ExtraData.APPSFLYER_ID, "1527256526604-2129416");
        var gdpr = PlayerPrefs.GetInt("result_gdpr_sdk", 0);

        Debug.Log("result_gdpr_sdk: " + gdpr);
        Appodeal.initialize(appKey,
                            Appodeal.INTERSTITIAL | Appodeal.BANNER_VIEW | Appodeal.REWARDED_VIDEO | Appodeal.MREC, gdpr == 1);
        Appodeal.setBannerCallbacks(this);
        Appodeal.setInterstitialCallbacks(this);
        Appodeal.setRewardedVideoCallbacks(this);
        Appodeal.setMrecCallbacks(this);
        Appodeal.setSegmentFilter("newBoolean", true);
        Appodeal.setSegmentFilter("newInt", 1234567890);
        Appodeal.setSegmentFilter("newDouble", 123.123456789);
        Appodeal.setSegmentFilter("newString", "newStringFromSDK");
    }
Ejemplo n.º 13
0
 public void displayBanner()
 {
     if (Appodeal.isLoaded(Appodeal.BANNER_BOTTOM))
     {
         Appodeal.show(Appodeal.BANNER_BOTTOM);
     }
 }
Ejemplo n.º 14
0
 public void DisplayInter()
 {
     if (Appodeal.isLoaded(Appodeal.INTERSTITIAL))
     {
         Appodeal.show(Appodeal.INTERSTITIAL);
     }
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Просмотр видеорекламы с вознаграждением
 /// </summary>
 public void ShowRewardedVideo()
 {
     if (Appodeal.isLoaded(Appodeal.REWARDED_VIDEO))
     {
         Appodeal.show(Appodeal.REWARDED_VIDEO);
     }
 }
Ejemplo n.º 16
0
 private void OnApplicationFocus(bool hasFocus)
 {
     if (hasFocus)
     {
         Appodeal.onResume(Appodeal.BANNER_BOTTOM);
     }
 }
Ejemplo n.º 17
0
    public void Init()
    {
        //Example for UserSettings usage
        UserSettings settings = new UserSettings();

        settings.setUserId("1234567890").setAge(25).setBirthday("01/01/1990").setAlcohol(UserSettings.Alcohol.NEUTRAL)
        .setSmoking(UserSettings.Smoking.NEUTRAL).setEmail("*****@*****.**").setFacebookId("0987654321")
        .setVkId("87654321").setGender(UserSettings.Gender.OTHER).setRelation(UserSettings.Relation.DATING)
        .setInterests("gym, cars, cinema, science").setOccupation(UserSettings.Occupation.WORK);

        if (LoggingToggle.isOn)
        {
            Appodeal.setLogging(true);
        }
        if (TestingToggle.isOn)
        {
            Appodeal.setTesting(true);
        }
        if (ConfirmToggle.isOn)
        {
            Appodeal.confirm(Appodeal.SKIPPABLE_VIDEO);
        }
        Appodeal.setBannerCallbacks(this);
        Appodeal.setInterstitialCallbacks(this);
        Appodeal.setSkippableVideoCallbacks(this);
        Appodeal.setRewardedVideoCallbacks(this);
        Appodeal.disableWriteExternalStoragePermissionCheck();
        Appodeal.initialize(appKey, Appodeal.INTERSTITIAL | Appodeal.BANNER | Appodeal.SKIPPABLE_VIDEO | Appodeal.REWARDED_VIDEO);
    }
Ejemplo n.º 18
0
 void Start()
 {
     Appodeal.initialize(appKey, Appodeal.INTERSTITIAL | Appodeal.REWARDED_VIDEO);
     Appodeal.setRewardedVideoCallbacks(this);
     Appodeal.setLogging(true);
     //Appodeal.setTesting(true);
 }
Ejemplo n.º 19
0
    private void Start()
    {
        Initialize();

        Appodeal.setRewardedVideoCallbacks(this);
        Appodeal.setInterstitialCallbacks(this);
    }
 // Update is called once per frame
 void Update()
 {
     if (Appodeal.isLoaded(Appodeal.NON_SKIPPABLE_VIDEO))
     {
         ad.SetActive(true);
     }
 }
Ejemplo n.º 21
0
 public void ShowVideoForCoins()
 {
     if (Appodeal.canShow(Appodeal.REWARDED_VIDEO))
     {
         Appodeal.show(Appodeal.REWARDED_VIDEO, "AddCoins");
     }
 }
    // Use this for initialization
    void Start()
    {
        String appKey = "0d325b3ff3ae5c6fdc25096f2f800f199b6a60ab58874e83";

        Appodeal.initialize(appKey, Appodeal.INTERSTITIAL);
        Appodeal.hide(Appodeal.BANNER_TOP);
    }
Ejemplo n.º 23
0
 public void ShowBanner()
 {
     if (Appodeal.isLoaded(Appodeal.BANNER))
     {
         Appodeal.show(Appodeal.BANNER_BOTTOM);
     }
 }
Ejemplo n.º 24
0
        IEnumerator ShowVideoRewardedCoroutine(Action success, Action failed)
        {
            if (statusVideoRewarded != StatusVideoRewarded.Loaded)
            {
                failed?.Invoke();
                yield break;
            }

            ui.Block();
            music.SetVolume(0f);

            Log("Ads - Appodeal - Predicted eCPM for Rewarded Video: " + Appodeal.getPredictedEcpm(Appodeal.REWARDED_VIDEO));
            Log($"Ads - Appodeal - Reward currency: {Appodeal.getRewardParameters().Key}, amount: {Appodeal.getRewardParameters().Value}");

            Appodeal.show(Appodeal.REWARDED_VIDEO);

            while (statusVideoRewarded != StatusVideoRewarded.Closed)
            {
                yield return(null);
            }

            Log("Ads - Appodeal Result Finished");

            Analytic.EventPropertiesImportant("Ads", "Appodeal VideoRewarded Result", "Finished");

            ui.Unblock();
            music.SetVolume(music.volumeNormal);

            success?.Invoke();
        }
Ejemplo n.º 25
0
 public void ShowBanner()
 {
     if (PlayerPrefs.GetInt("NoAds") != 1)
     {
         Appodeal.show(Appodeal.BANNER_BOTTOM, "default");
     }
 }
Ejemplo n.º 26
0
 public void initialize(string appKey, int adTypes, bool hasConsent)
 {
     getAppodealClass().CallStatic("setFramework", "unity", Appodeal.getPluginVersion(),
                                   Appodeal.getUnityVersion(), true, false);
     getAppodealClass().CallStatic("initialize", getActivity(), appKey, nativeAdTypesForType(adTypes),
                                   hasConsent);
 }
 void OnApplicationFocus(bool hasFocus)
 {
     if (hasFocus)
     {
         Appodeal.onResume();
     }
 }
Ejemplo n.º 28
0
        protected override void Start()
        {
            base.Start();

            // Активируем обратные вызовы для видеорекламы
            Appodeal.setRewardedVideoCallbacks(this);
        }
Ejemplo n.º 29
0
 public void ShowInterstitial()
 {
     if (Appodeal.canShow(Appodeal.INTERSTITIAL) && !Appodeal.isPrecache(Appodeal.INTERSTITIAL))
     {
         Appodeal.show(Appodeal.INTERSTITIAL);
     }
 }
Ejemplo n.º 30
0
        public void WatchAd(string contentType, Action action)
        {
#if UNITY_EDITOR
            rewardAction = () => {
                Services.GetService <IFacebookService>()?.AddTotalAdsCount(contentType, 1);
                action?.Invoke();
            };
            rewardAction.Invoke();
#else
            if (isAdWaiting)
            {
                return;
            }
            if (!Appodeal.isLoaded(Appodeal.REWARDED_VIDEO))
            {
                WaitAdData waitData = new WaitAdData {
                    ContentType = contentType,
                    Action      = action
                };
                ViewService.Show(ViewType.WaitAdView, new ViewData {
                    UserData  = waitData,
                    ViewDepth = ViewService.NextViewDepth
                });
                return;
            }
            rewardAction = () => {
                Services.GetService <IFacebookService>()?.AddTotalAdsCount(contentType, 1);
                action?.Invoke();
            };
            GameEvents.AdWillBePlayedSubject.OnNext(true);
            Appodeal.show(Appodeal.REWARDED_VIDEO);
            isAdWaiting = true;
#endif
        }