问题
My question is same as this thread but the answer in it does not work anymore because ParseFacebookUtils.getSession() has been deprecated.
What is the replacement on how to log out and flush the cache so that next time the Facebook login button appears again.
Just doing ParseUser.logOut() did not help.
Here is my code to login:
List<String> permissions = Arrays.asList("public_profile", "email");
ParseFacebookUtils.logInWithReadPermissionsInBackground(this, permissions, new LogInCallback() {
@Override
public void done(ParseUser user, ParseException err) {
Log.v("debug", "Did enter the done for LoginCallBack.");
if (user == null) {
Log.v("debug", "Uh oh. The user cancelled the Facebook login.");
} else if (user.isNew()) {
Log.v("debug", "User signed up and logged in through Facebook!");
} else {
Log.v("debug", "User logged in through Facebook!");
}
}
});
I have tried to logout with the code below, but it still does not help.
//Now call logout
ParseUser.logOutInBackground(new LogOutCallback() {
@Override
public void done(ParseException e) {
Log.v("debug", "in LogOutCallback() - done() - i guess successfully done?");
}
});
回答1:
I haven't find a way to do that so i think that there is no way to do that if the user has the FB app installed.
I think it works like this:
If the user doesn't have the FB app then the login is always shown.
If the user has the FB app, then the first time is asked to login (or permissions ,I don't remember), then the login doesn't appear anymore unless the user logouts from FB app.
来源:https://stackoverflow.com/questions/32754339/parsefacebookutils-how-to-open-facebook-login-dialog-every-time