Facebook iOS 3.1 SDK:可以使用Safari登录,但不能本地登录 [英] Facebook iOS 3.1 SDK: can login with Safari but not natively

查看:95
本文介绍了Facebook iOS 3.1 SDK:可以使用Safari登录,但不能本地登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在集成iOS 3.1 Facebook SDK.当使用Facebook功能实现登录时,我呼叫FBSession openActiveSessionWithReadPermissions:allowLoginUI:completionHandler:.当在模拟器上调用时(我没有在本地设置FB帐户),我可以成功登录.

I'm integrating the iOS 3.1 Facebook SDK. When implementing a login with Facebook feature, I call FBSession openActiveSessionWithReadPermissions:allowLoginUI:completionHandler:. When called on the simulator (where I don't have a FB account set up natively) I can successfully login.

但是,从具有本地Facebook帐户设置的设备上,调用openActiveSessionWithReadPermissions...时,在完成处理程序中返回的会话类型始终为sessionStateClosedLoginFailed,无论我是允许还是禁止我的应用在警报对话框中使用Facebook .调用该方法之前的会话状态为sessionStateCreated.

However, from a device with a native Facebook account setup, when calling openActiveSessionWithReadPermissions... the session type returned in the completion handler is always sessionStateClosedLoginFailed, regardless of whether I allow or disallow my app to use Facebook in the alert dialog. The session state before calling the method is sessionStateCreated.

这是完成处理程序中的NSError: Error Domain=com.facebook.sdk Code=2 "The operation couldn’t be completed. (com.facebook.sdk error 2.)" UserInfo=0x20a80820 {com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:ErrorLoginFailedReason, com.facebook.sdk:ErrorInnerErrorKey=Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (No value.) UserInfo=0x208ed930 {NSDebugDescription=No value.}}

This is the NSError from the completion handler: Error Domain=com.facebook.sdk Code=2 "The operation couldn’t be completed. (com.facebook.sdk error 2.)" UserInfo=0x20a80820 {com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:ErrorLoginFailedReason, com.facebook.sdk:ErrorInnerErrorKey=Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (No value.) UserInfo=0x208ed930 {NSDebugDescription=No value.}}

我做错了什么会导致这个问题?

What am I doing wrong that would cause this problem?

更新:我只是注意到我的应用程序没有出现在设置">"Facebook">允许这些应用程序使用您的帐户"部分.(今天早些时候肯定在那里).

Update: I just noticed that my app is not appearing in the Settings > Facebook > "Allow these apps to use your account' section. (It was definitely there earlier today).

Update2 :如果我从iOS设置应用中删除帐户,然后将测试用户登录到Facebook iPhone应用中,则可以通过快速应用切换来登录.因此,这似乎仅是本机帐户的问题.

Update2: If I delete my account from the iOS Settings app, and then log my test user into the Facebook iPhone app, I am able to login with fast app switching. So it appears to only be a problem with the native account.

Update3 :我运行了示例Facebook应用程序Scrumptious,我遇到了同样的问题.点击登录"后,调用openActiveSessionWithRead...,我会遇到相同的错误.

Update3: I ran the sample Facebook app Scrumptious I have the same problem. Upon clicking 'Login', which calls the openActiveSessionWithRead... I get the same error.

Update4 :可能与此错误有关? http://developers.facebook.com/bugs/450137751688028?browse=search_50a43a39b37ae4868318658

Update4: Possibly related to this bug? http://developers.facebook.com/bugs/450137751688028?browse=search_50a43a39b37ae4868318658

Update5 :我应该早先提到过这一点,但这是Facebook测试用户帐户中存在此问题.

Update5: I should have mentioned this earlier, but it was a Facebook test user account that had this problem.

推荐答案

我从使用Facebook测试用户帐户切换为普通帐户,这解决了Scrumptious应用程序和我的应用程序上的问题.

I switched from using a Facebook test user account to a regular account and this solved the problem on both the Scrumptious app and my app.

这篇关于Facebook iOS 3.1 SDK:可以使用Safari登录,但不能本地登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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