问题
In my app, I allow users to login to and logout from Facebook programmatically.
For login, I call:
ArrayList<String> permissions = new ArrayList();
permissions.add("manage_pages");
permissions.add("publish_actions");
LoginManager.getInstance().logInWithPublishPermissions(App.activity, permissions);
And for logout, I call:
FacebookSdk.sdkInitialize(getApplicationContext());
LoginManager.getInstance().logOut();
When I call the logInWithPublishPermissions() method above, the official Facebook app opens prompting the user to login, and after the user logs in, they become logged in to both my app as well as the official Facebook app.
However, when I call the logout() method above, the user is not logged out from the official Facebook app. Is there a way to make this happen, i.e. signing out from my app will force signing out from the official app? A type of 'single sign-off,' if you will?
回答1:
No. It is a common problem even with oauth type "signup via facebook or gmail", where even if you logout from the third party app, you dont get out of fb or google. There is no mechanism which can make your app issue logout command to facebook app.
来源:https://stackoverflow.com/questions/30176996/android-facebook-4-0-logout-programmatically