简体   繁体   English

通过iOS登录Facebook

[英]Facebook login via iOS

I recently have a problem for my Facebook integration into my app. 我最近在将Facebook集成到我的应用程序时遇到问题。

I want the app to be able to ask for user to type in their username and password every time they want to connect to Facebook, I tried the example that comes in the Facebook SDK "switch User", but I still have some problems in integrating the function into my app. 我希望该应用程序能够要求用户每次想连接到Facebook时都输入用户名和密码,我尝试了Facebook SDK“切换用户”中的示例,但是在集成时仍然存在一些问题该功能进入我的应用。

Could anyone help me out? 有人可以帮我吗? Thanks! 谢谢!

Use FBLoginView it will display a Login Button for Logging in with FBSDK and during logout functionality in your product, write this: [FBSession.activeSession closeAndClearTokenInformation]; 使用FBLoginView,它将显示一个用于使用FBSDK登录的登录按钮,并在您产品的注销功能期间,输入以下内容: [FBSession.activeSession closeAndClearTokenInformation]; and then dipslay the FBLoginView so that it will allow user to relogin into your product. 然后浸入FBLoginView,以便它允许用户重新登录到您的产品。

thanks for answering my question. 谢谢回答我的问题。 I finally solved the problem by creating a button and add a IBAction to perform the log in/out, and when user is trying to login, I open the session by using the FBSessionBehaviorForcingWebView, which will allow different users to log in since it asks user for email & password every time. 我终于通过创建按钮并添加IBAction来执行登录/注销来解决该问题,并且当用户尝试登录时,我使用FBSessionBehaviorForcingWebView打开了会话,这将允许不同的用户登录,因为它询问用户每次输入电子邮件和密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM