[英]Facebook SSO for iOS7 not working
i am having issue with facebook SSO. 我在使用Facebook SSO时遇到问题。 I am trying to do facebook SSO with the following method 我正在尝试使用以下方法来做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]; }];
}
This opens up the active session successfully for iOS6 and earlier but not working for iOS 7. If i am using openActiveSessionWithPermissions(this is depreciated) instead of openActiveSessionWithReadPermissions (Which is the preferred method) in Facebook SSO then its working for iOS 7 as well. 这将成功打开适用于iOS6和更早版本的活动会话,但不适用于iOS7。如果我在Facebook SSO中使用openActiveSessionWithPermissions(已弃用)(而不是openActiveSessionWithReadPermissions(首选方法)),那么它也适用于iOS 7。 for example if i am using 例如,如果我正在使用
-(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]; }];
}
then its working. 然后它的工作。 Its very confusing. 它非常令人困惑。 Let me know if you need more information. 如果您需要更多信息,请与我们联系。 Please help Guys. 请帮助伙计们。
Looks like i was using the older version of the facebook sdk. 看起来我正在使用旧版本的Facebook SDK。 With the latest Version its working fine. 使用最新版本可以正常工作。
Special thanks to @Ming Li for the help. 特别感谢@Ming Li的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.