如何在android中登录多个facebook帐户?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10912242/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 05:26:32  来源:igfitidea点击:

how to do multiple facebook accounts login in android?

androidfacebookfacebook-oauth

提问by user749873

I am creating an Android application by which user can post messages and updates their status on Facebook with the different Facebook accounts so is their any possibility to do multiple Facebook Login with the same(my) app, please provide me suggestions how can I do this in android. Thanks..

我正在创建一个 Android 应用程序,用户可以通过该应用程序使用不同的 Facebook 帐户在 Facebook 上发布消息并更新他们的状态,因此他们是否有可能使用同一个(我的)应用程序进行多个 Facebook 登录,请为我提供建议,我该怎么做在安卓中。谢谢..

回答by Nitzan Tomer

If you are using the fb android sdk for authentication then the login is bound to the logged in user in the main facebook app (katana) on the mobile device (in case it's installed).

如果您使用 fb android sdk 进行身份验证,则登录将绑定到移动设备上主要 facebook 应用程序 (katana) 中的登录用户(如果已安装)。

Even if you sign the user out from your application the next time he opens the application the same user will still be used since he is logged in using the facebook app.
Only if the user logs out of the facebook app and logs in using a different account, then your app will be able to use that account.

即使您在用户下次打开应用程序时从您的应用程序中注销,由于他是使用 facebook 应用程序登录的,因此仍将使用相同的用户。
只有当用户退出 Facebook 应用程序并使用不同的帐户登录时,您的应用程序才能使用该帐户。

What you can do is to authenticate the user without the SSO.
In this case, which is like the case in which the facebook app is not installed on the device, the authentication is happening using the SDK which opens the oAuth dialog.
The problem with this approach is that the user needs to enter his e-mail and password, which is not that much fun task to do with most mobile devices.
If you decide to go with this approach read this thread: How to disable Facebook single sign on for android - Facebook-android-sdk

您可以做的是在没有 SSO 的情况下对用户进行身份验证。
在这种情况下,就像设备上未安装 facebook 应用程序的情况一样,身份验证是使用打开 oAuth 对话框的 SDK 进行的。
这种方法的问题在于用户需要输入他的电子邮件和密码,这对于大多数移动设备来说并不是什么有趣的任务。
如果您决定采用这种方法,请阅读此线程:如何为 android 禁用 Facebook 单点登录 - Facebook-android-sdk