Facebook SDK iOS error 2

非 Y 不嫁゛ 提交于 2019-12-24 08:20:59

问题


I'm trying to log into facebook with their API using

[FBSession openActiveSessionWithReadPermissions:permissions
                                   allowLoginUI:YES
                              completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
                                                     [self sessionStateChanged:session state:state error:error];
                                                 }]

The problem I'm having is in iOS 6.x when the device has a facebook account linked in the settings app it fails to log in. The error it gives is the seemingly one-size-fits-all error 2. This is the only case where it fails and I can't understand why. What is a solution to let me log in while an account is linked?


回答1:


check that your permissions array does not contain the offline_access permission. this permission is now deprecated and has been known to cause login to fail. i previously searched stack overflow and found this answer. you'll also need to go into Settings -> Facebook and switch the permission on the Allowed Apps to On.




回答2:


I was getting this error due to the app being sandboxed. Check facebook developer and add your team.




回答3:


Go to settings. Scroll all the way down until you see Facebook on left hand side tab, on it, allow these apps to use your account (right hand side).

Look for the app that gives you the sdk error 2.



来源:https://stackoverflow.com/questions/17292666/facebook-sdk-ios-error-2

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