private void Awake()
    {
        _parseClient = ParseClientGO.GetComponent <IParseClient>();
        _uniWebView  = UniWebViewGO.GetComponent <UniWebView>();
        _navigation  = NavigationGO.GetComponent <INavigation>();


        _playerConfig.Reset();
        UniWebViewLogger.Instance.LogLevel = UniWebViewLogger.Level.Verbose;
        UniWebView.ClearCookies();

        _parseClient.SetSessionToken(_config.SessionToken);
        _uniWebView.OnMessageReceived += (webView, message) =>
        {
            _config.SessionToken = message.Args["token"];
            _uniWebView.Hide();
            _parseClient.SetSessionToken(_config.SessionToken);
            CheckSession();
        };
    }
Exemple #2
0
    public void Logout()
    {
        Debug.Log("Logout - Start");
        //TODO: Delete all playerprefs???
        PlayerPrefs.DeleteKey(AppDB.Instance.nameKey);
        PlayerPrefs.DeleteKey(AppDB.Instance.surnameKey);
        PlayerPrefs.DeleteKey(AppDB.Instance.emailKey);
        PlayerPrefs.DeleteKey(AppDB.Instance.qualificaKey);
        PlayerPrefs.DeleteKey(AppDB.Instance.authenticationTokenKey);
        PlayerPrefs.DeleteKey(AppDB.Instance.user_idKey);
        PlayerPrefs.Save();
        // File.Delete(AppDB.Instance.GetUser_QrCodePath());

        // profile_UniWebView.Hide();
        //profileTabGO?.SetActive(false);
        UniWebView.ClearCookies();              //TODO: change to SetCookies()
        login_UniWebView.CleanCache();          //TODO: unsure we need it, but just in case

        Debug.Log("Logout - End");

        Application.Quit();
        // Login_AppManager.Instance.ChangeStateToLogin();
    }