private void OnApplicationPause(bool pauseStatus)
        {
            if (pauseStatus || ProjectServer.Provider == LocaleUtils.GetProvider())
            {
                return;
            }

            if (m_User != null)
            {
                Logout();
            }
            ProjectServer.Cleanup();
            ProjectServer.Init();
        }
        void OnDisable()
        {
            authBackend = null;
            if (m_Interop != null)
            {
                m_Interop.OnDisable();
                m_Interop = null;
            }
            if (m_StartGetUserInfo != null)
            {
                StopCoroutine(m_StartGetUserInfo);
            }
            m_UnityUserTask = null;

            ProjectServer.Cleanup();
        }
        void Awake()
        {
            // Called as soon as we can
            SetupProxy();

            if (tokenUpdated == null)
            {
                tokenUpdated = new TokenEvent();
            }
            if (authenticationFailed == null)
            {
                authenticationFailed = new FailureEvent();
            }
            if (userLoggedIn == null)
            {
                userLoggedIn = new UnityUserUnityEvent();
            }
            if (userLoggedOut == null)
            {
                userLoggedOut = new UnityEvent();
            }
            if (linkSharingDetected == null)
            {
                linkSharingDetected = new LinkSharingEvent();
            }
            if (openInViewerDetected == null)
            {
                openInViewerDetected = new OpenInViewerEvent();
            }

            ProjectServer.Init();

            authBackend = new AuthBackend(this);
#if UNITY_STANDALONE_WIN && !UNITY_EDITOR
            m_Interop = new Interop(this);
            m_Interop.Start();
#endif

            m_TokenPersistentPath = Path.Combine(Application.persistentDataPath, AuthConfiguration.JwtTokenFileName);
        }
 protected virtual void OnDestroy()
 {
     Hook.Shutdown();
     // HACK: this is required because a client is always created and therefore needs to be disposed of properly
     ProjectServer.Cleanup();
 }