Android Facebook 4.0以编程方式注销 [英] Android Facebook 4.0 Logout Programmatically

查看:66
本文介绍了Android Facebook 4.0以编程方式注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我允许用户以编程方式登录和注销Facebook.

In my app, I allow users to login to and logout from Facebook programmatically.

要登录,我打电话:

ArrayList<String> permissions = new ArrayList();
permissions.add("manage_pages");
permissions.add("publish_actions");
LoginManager.getInstance().logInWithPublishPermissions(App.activity, permissions);

要登出,我打电话:

FacebookSdk.sdkInitialize(getApplicationContext());
LoginManager.getInstance().logOut();

当我调用上面的logInWithPublishPermissions()方法时,正式的Facebook应用会打开,提示用户登录,并且在用户登录后,他们既登录了我的应用,也登录了正式的Facebook应用.

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.

但是,当我调用上面的logout()方法时,该用户并未从官方Facebook应用程序注销.有没有办法做到这一点,即从我的应用中退出会强制从官方应用中退出?如果愿意,是一种单次签核"吗?

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?

推荐答案

否.即使使用oauth类型通过facebook或gmail注册",这也是一个常见问题,即使您从第三方应用程序注销,也不会退出fb或google.没有任何机制可以使您的应用程序向Facebook应用程序发出注销命令.

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.

这篇关于Android Facebook 4.0以编程方式注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆