我在使用 facebook SSO 时遇到问题。我正在尝试使用以下方法进行 facebook SSO
-(BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
NSLog(@"inside openSessionWithAllowLoginUI");
NSArray *permissions = [[NSArray alloc] initWithObjects:@"offline_access,user_birthday,email,user_status", nil];
return [FBSession openActiveSessionWithReadPermissions:[permissions autorelease] allowLoginUI:allowLoginUI completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {[ self sessionStateChanged:session state:state error:error]; }];
}
这会成功打开 iOS6 及更早版本的活动会话,但不适用于 iOS 7。如果我在 Facebook SSO 中使用 openActiveSessionWithPermissions(已弃用)而不是 openActiveSessionWithReadPermissions(这是首选方法),那么它也适用于 iOS 7。例如,如果我正在使用
-(BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
NSLog(@"inside openSessionWithAllowLoginUI");
NSArray *permissions = [[NSArray alloc] initWithObjects:@"offline_access,user_birthday,email,user_status", nil];
return [FBSession openActiveSessionWithPermissions:[permissions autorelease] allowLoginUI:allowLoginUI completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {[ self sessionStateChanged:session state:state error:error]; }];
}
然后它的工作。它非常混乱。如果您需要更多信息,请与我们联系。请帮助伙计们。