【问题标题】:How to logout ParseUser linked with Twitter in android如何在android中注销与Twitter链接的ParseUser
【发布时间】:2014-10-13 18:55:35
【问题描述】:

我使用 ParseTwitterUtils 在解析中登录:

ParseTwitterUtils.logIn(this, new LogInCallback()
    {
        @Override
        public void done(ParseUser user, ParseException err)
        {
            if(user == null)
            {
                Log.d(TAG, "Uh oh. The user cancelled the Twitter login.");
            }
            else if(user.isNew())
            {
                Log.d(TAG, "User signed up and logged in through Twitter!");
                navigateToMainActivity();
            }
            else
            {
                Log.d(TAG, "User logged in through Twitter!");
                Log.d(TAG, "user id=" + user.getObjectId());
                Log.d("TAG", "username=" + user.getUsername());
                navigateToMainActivity();
            }
        }
    });

我使用以下方式注销用户:

ParseUser.logOut();

但是,当我尝试使用 ParseTwitterUtils 再次登录时,我会看到只有 Authorize app 按钮的 webView。按下 Authorize app 后,我在 done 方法中获得了非空用户,但用户的所有其他字段均为空,例如 userId、用户名等。我认为应用程序正在本地授权 twitter,因此不会将用户从 Parse 中获取。如何强制 Parse 在注销时清除 Twitter 会话信息,或者如何在不这样做的情况下在 ParseTwitterUtils.login 中获得正确的用户?

【问题讨论】:

    标签: android twitter parse-platform


    【解决方案1】:

    我遇到了这个问题,因为我在应用程序类中启用了 Parse local datastore

    Parse.enableLocalDatastore(this);
    

    我刚刚禁用了 Parse 本地数据存储,Twitter 登录工作正常。

    【讨论】:

    • 如果我们需要本地数据存储怎么办?
    猜你喜欢
    • 1970-01-01
    • 2011-10-09
    • 2012-08-03
    • 1970-01-01
    • 2014-08-12
    • 1970-01-01
    • 2016-04-07
    • 1970-01-01
    • 2010-12-29
    相关资源
    最近更新 更多