/// <summary> /// Gets the app lifecycle manager. /// </summary> /// <returns>The app lifecycle manager.</returns> public IPsdkAppLifeCycleManager GetAppLifecycleManager() { #if UNITY_EDITOR return(new PsdkAppLifeCycleMgrStub()); #endif if (!isPsdkValid()) { return(null); } if (null != _appLifeCycleMgrService) { return(_appLifeCycleMgrService); } _appLifeCycleMgrService = GettingServiceByReflection <IPsdkAppLifeCycleManager>("PsdkAppLifeCycleManager"); if (null != _appLifeCycleMgrService) { return(_appLifeCycleMgrService); } if (!_silent) { Debug.Log("Please install PsdkAppLifeCycleManager !"); } return(null); }
public PsdkAppLifeCycleManager(IPsdkServiceManager sm) { _sm = sm; switch (Application.platform) { case RuntimePlatform.IPhonePlayer: _impl = new IphonePsdkAppLifeCycleManager(sm.GetImplementation()); break; #if UNITY_ANDROID case RuntimePlatform.Android: _impl = new AndroidPsdkAppLifeCycleManager(sm.GetImplementation()); break; #endif case RuntimePlatform.WindowsEditor: case RuntimePlatform.OSXEditor: _impl = new UnityEditorPsdkAppLifeCycleManager(sm.GetImplementation()); break; default: throw new System.Exception("Platform not supported for PsdkAppLifeCycleManager."); } // #if UNITY_IPHONE && !UNITY_EDITOR // _impl = new IphonePsdkAppLifeCycleManager(sm.GetImplementation()); // #elif UNITY_ANDROID && !UNITY_EDITOR // _impl = new AndroidPsdkAppLifeCycleManager(sm.GetImplementation()); // #elif UNITY_EDITOR // _impl = new UnityEditorPsdkAppLifeCycleManager(sm.GetImplementation()); // #endif }
public void AppIsReady() { IPsdkAppLifeCycleManager alm = GetAppLifecycleManager(); if (alm != null) { alm.AppIsReady(); } }
/// <summary> /// Setups the app lifecycle manager. /// </summary> /// <returns><c>true</c>, if app lifecycle manager was setuped, <c>false</c> otherwise.</returns> public bool SetupAppLifecycleManager() { registerInternalService(_appLifeCycleMgrService = GetAppLifecycleManager()); if (null != _appLifeCycleMgrService) { return(_appLifeCycleMgrService.Setup()); } return(false); }
public bool OnBackPressed() { IPsdkAppLifeCycleManager alm = GetAppLifecycleManager(); if (alm != null) { return(alm.OnBackPressed()); } return(false); }