public AppLifeCycleResumeState OnResume() { AppLifeCycleResumeState state = _nextState; if ((Time.realtimeSinceStartup - _pausedTime) >= 360f) { state = AppLifeCycleResumeState.ALCRS_NEW_SESSION; } if ((Time.realtimeSinceStartup - _pausedTime) >= 3000f) { state = AppLifeCycleResumeState.ALCRS_RESTART_APP; } _nextState = AppLifeCycleResumeState.ALCRS_RESUME; return(state); }
private void OnResumeEvent(AppLifeCycleResumeState resumeState) { PSDKMgr.Instance.AppIsReady(); Action eventToFire = null; if (resumeState == AppLifeCycleResumeState.ALCRS_NEW_SESSION) { eventToFire = OnNewSession; } else if (resumeState == AppLifeCycleResumeState.ALCRS_RESTART_APP) { eventToFire = OnRestartGame; } if (eventToFire != null) { eventToFire(); } }
private void OnPsdkResumed(AppLifeCycleResumeState rs) { Debug.Log("Psdk.OnPsdkResumed :" + rs.ToString() + ", First scene loaded: " + _firstSceneLoaded); PSDKMgr.Instance.AppIsReady(); if (rs == AppLifeCycleResumeState.ALCRS_RESTART_APP) { Debug.Log("OnPsdkResumed.AppRestart -" + _firstSceneLoaded); if (_firstSceneLoaded) { psdkRestartAppSignal.Dispatch(); } } // // if(rs == AppLifeCycleResumeState.ALCRS_NEW_SESSION || // rs == AppLifeCycleResumeState.ALCRS_RESTART_APP) // { // if(_firstSceneLoaded) // { // psdkSessionStartSignal.Dispatch(); // } // } }
public AppLifeCycleResumeState OnResume() { AppLifeCycleResumeState rs = (AppLifeCycleResumeState)psdkAlmOnResume(); return(rs); }
public void OnResume(AppLifeCycleResumeState resumeState) { Debug.Log("PublishingSDKCoreDemo - OnResume - resumeState = " + resumeState.ToString()); }
/// <summary> /// <summary>_analyticsService /// Setup the specified store, domain, language and orientation. /// </summary> /// <param name="store">Store.</param> /// <param name="domain">Domain.</param> /// <param name="language">Language.</param> /// <param name="orientation">Orientation.</param> public bool Setup(string language = null, string configJson = null) { if (_psdkSetup) { return(true); } _psdkSetup = true; PsdkEventSystem.Instance.Init(); _configJson = configJson; LogPsdkVersions(); if (System.String.IsNullOrEmpty(_configJson)) { Debug.Log("Reading psdk json configuration from steamingAssets/psdk.json file !"); _configJson = PsdkUtils.ReadPsdkConfigFromFile(); } if (System.String.IsNullOrEmpty(_configJson)) { Debug.LogError("Null or empty psdk configuration json, please put it in Assets/SteamingAssets/psdk.json !"); return(false); } PsdkUtils.NativeLog("psdk config: " + _configJson); LocalConfig = new PsdkLocalConfig(_configJson); if (LocalConfig.GetBool(new string[] { "appsFlyer", "included" }, false) && LocalConfig.GetBool(new string[] { "singular", "included" }, false)) { Debug.LogError("appsFlyer and singluar are both included. this is not allowed. build will fail."); } DebugMode = isDebugMode(_configJson); RunObbDownloaderIfNeeded(); SetupAppLifecycleManager(); // initial analytics listner PsdkEventSystem.Instance.Init(); if (!SetupCrossDevicePersistency()) { Debug.Log("CrossDevicePersistency not initialized !"); } if (!SetupBilling()) { Debug.Log("Billing not initialized !"); } if (!SetupRateUs()) { Debug.Log("RateUs not initialized !"); } if (!SetupShare()) { Debug.Log("Share not initialized !"); } if (!SetupSocial()) { Debug.Log("Social not initialized !"); } if (!SetupAudience()) { Debug.Log("PSDK Audience not initialized!"); } if (!SetupInAppPurchase()) { Debug.Log("PSDK InAppPurchase not initialized!"); } if (!SetupExternalConfiguration()) { Debug.Log("PSDK External Configuration not initialized!"); } if (!SetupAnalyticsService()) { Debug.Log("PSDK Analytics not inititalized !"); } if (!SetupLocationManagerService()) { Debug.Log("location manager not inititalized !"); } if (!SetupRewardedAdsService()) { Debug.Log("RewardedAds not initialized !"); } if (!SetupGameLevelData()) { Debug.Log("GLD not initialized !"); } if (!SetupSplash()) { Debug.Log("Splash not initialized !"); } if (!SetupBanners()) { Debug.Log("Banners not initialized !"); } if (!SetupCrashMonitoringTool()) { Debug.Log("CrashMonitoringTool not initialized !"); } if (!SetupNativeCampaign()) { Debug.Log("NativeCampaign not initialized !"); } if (!SetupSingular()) { Debug.Log("Singular not initialized !"); } // string newConfigJson = preProcessConfigJsonAccordingToInstalledPkgs(_configJson); bool rc = false; if (null != _impl) { rc = _impl.Setup(_configJson, language); _nativePsdkStarted = true; _silent = false; PsdkEventSystem.RegisterNativeCallbacksAfterPsdkInitialization(); } if (rc) { AppLifeCycleResumeState or = _appLifeCycleMgrService.OnResume(); Debug.Log("PSDKMgr::Start resume state: " + or.ToString()); foreach (IPsdkService ps in _registeredServices) { try { ps.psdkStartedEvent(); } catch (System.Exception e) { Debug.LogException(e); } } if (or != AppLifeCycleResumeState.ALCRS_NONE) { PsdkEventSystem.Instance.SendMessage("OnResumeEvent", or); } } return(rc); }