Android Facebook 4.0 Logout Programmatically

旧巷老猫 提交于 2021-02-19 03:08:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!