Example #1
0
    //private void OnFirebaseTokenReceived(object sender, TokenReceivedEventArgs e)
    //{
    //	FMLogger.Log("firebase token received.");
    //	if (e != null && !string.IsNullOrEmpty(e.Token))
    //	{
    //		AdjustHelper.SetUninstallToken(e.Token);
    //	}
    //	FMLogger.vCore("firebase token " + e.Token);
    //}

    private void OnApplicationPause(bool pauseStatus)
    {
        if (!pauseStatus)
        {
            this.CheckDailyBonus();
            base.StartCoroutine(this.DelayAction(0.1f, delegate
            {
                if (this.deepLinker != null)
                {
                    this.deepLinker.Check();
                }
            }));
            float delay = 1f;
            if (AppManager.__f__mg_cache1 == null)
            {
                AppManager.__f__mg_cache1 = new Action(AppState.ResetPauseState);
            }
            base.StartCoroutine(this.DelayAction(delay, AppManager.__f__mg_cache1));
        }
        else
        {
            AppState.ValidatePauseState();
        }
        if (pauseStatus)
        {
            PlayTimeEventTracker.AppPause();
            UserLifecycle.AppPause();
        }
        else
        {
            UserLifecycle.AppResume();
            PlayTimeEventTracker.AppResume();
        }
    }
Example #2
0
 private void Start()
 {
     this.AdjustInit();
     this.FirebaseInit();
     this.CheckDailyBonus();
     try
     {
         PlayTimeEventTracker.AppResume();
     }
     catch (Exception ex)
     {
         UnityEngine.Debug.Log("PlayTimeEventTracker ex. " + ex.Message);
     }
     this.deepLinker = new DeeplinkController(base.GetComponent <FMDeepLink>());
     this.deepLinker.BonusCodeReceived += this.OnFBDeeplinkOpened;
     AppState.ContentReqTime            = DateTime.Now;
     base.StartCoroutine(this.LoadSysParameters(delegate
     {
         AdsManager.Instance.SetParams(this.adsId, this.adsLimitied);
         if (GeneralSettings.AdsDisabled)
         {
             FMLogger.vAds("casual disable ads on startup");
             AdsManager.Instance.DisableAds();
         }
         else
         {
             FMLogger.vAds("ads init");
             AdsManager.Instance.Init();
             AdsManager.Instance.StartFsInterval();
         }
         TGFModule.Instance.Init(this.adsId, this.adsLimitied, this.countryCode, this.langCode);
         ImageManager.Instance.Init();
         SharedData.Instance.Init();
         //FB.Init(null, null, null);
         AppState.LaunchTime = DateTime.Now;
         this.fairyController.StartTimer();
         this.deepLinker.Check();
         TGFModule.Instance.PrecachePages();
         try
         {
             AnalyticsManager.SetUserDeviceTypeProperty(SafeLayout.IsTablet);
         }
         catch (Exception ex2)
         {
             FMLogger.vCore("SetUserDeviceTypeProperty crash. " + ex2.Message);
         }
         float delay = 0.5f;
         if (AppManager.__f__mg_cache0 == null)
         {
             AppManager.__f__mg_cache0 = new Action(UserLifecycle.AppLaunch);
         }
         base.StartCoroutine(this.DelayAction(delay, AppManager.__f__mg_cache0));
         AppManager.inited = true;
         if (this.Loaded != null)
         {
             this.Loaded();
         }
     }));
 }