问题描述
我的loggedIn用解析ParseTwitterUtils:
I loggedIn in parse using 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();
}
}
});
我使用注销用户:
I logout the user using:
ParseUser.logOut();
然而,当我再次尝试使用ParseTwitterUtils登录,我psented与web视图,只有授权的应用程序按钮$ P $。 pressing经过授权的应用程序,我得到非空用户done方法,但该用户的所有其他字段为空,如用户id,用户名等。我认为应用程序是在本地授权的Twitter,因此不会从parse带给用户。我怎么可以强制解析以清除注销Twitter的会话信息或者我如何能得到正确的用户在ParseTwitterUtils.login没有这样做呢?
However when I try to login again using ParseTwitterUtils, I am presented with webView with only Authorize app button. After pressing Authorize app, I get non-null user in done method but all other fields of the user are null, e.g userId, username, etc. I think app is authorizing the twitter locally and thus not bringing the user from Parse. How can I force Parse to clear twitter session info on logout or how can I get right user in ParseTwitterUtils.login without doing this?
推荐答案
我遇到这个问题,因为我已经在应用程序类解析本地数据存储启用
I was experiencing this issue because I have enabled Parse local datastore in application class
Parse.enableLocalDatastore(this);
我只是禁用解析本地数据存储和Twitter的登录工作完美。
I just disabled the Parse local datastore and Twitter login is working perfectly.
这篇关于如何注销ParseUser与Twitter的链接的android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!