1

通过使用 facebook 进行身份验证后

FBSessionLoginBehavior behavior =   FBSessionLoginBehaviorForcingWebView;
appDelegate.session             =   [[FBSession alloc] init];

[appDelegate.session  openWithBehavior:behavior 
                     completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
                         NSLog(@"session is %d",session.state);
                         [self dismissViewControllerAnimated:YES completion:nil];


                     }
 ];

我总是得到

session is 513

问题 :

what is the meaning of 513   

请协助我解决这个问题。谢谢

4

2 回答 2

2

Facebook SDK 错误代码告诉我它是“用户无法通过 API 戳”。似乎是明确地处理 513 错误。也看看这个

于 2012-09-19T20:27:16.133 回答
2

FBSession.state = 513 是 FBSessionStateOpen。我找不到任何解释这一点的文档,可能的会话状态是:(在 iOS FacebookSDK 中找到)

FBSessionStateCreated                   = 0,
FBSessionStateCreatedTokenLoaded        = 1,
FBSessionStateCreatedOpening            = 2,
FBSessionStateOpen                      = 1 | FB_SESSIONSTATEOPENBIT,
FBSessionStateOpenTokenExtended         = 2 | FB_SESSIONSTATEOPENBIT,
FBSessionStateClosedLoginFailed         = 1 | FB_SESSIONSTATETERMINALBIT, // NSError obj 
FBSessionStateClosed                    = 2 | FB_SESSIONSTATETERMINALBIT, // "

数字是错误的,但州是对的。尝试“po session.state”,您将设置枚举值。

于 2014-04-29T11:10:08.393 回答