I have the following code that I use during facebook login.
- (BOOL)openFBSessionWithAllowLoginUI:(BOOL)allowLoginUI
withCompletionHandler:(void (^)())completionHandler
{
NSArray *permissions = [NSArray arrayWithObjects:
@"user_photos",
@"email",
nil];
return [FBSession openActiveSessionWithReadPermissions:permissions allowLoginUI:allowLoginUI completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
if (error != nil) {
...
} else {
switch (state) {
case FBSessionStateOpen:
{
...
}
case FBSessionStateClosed:
{
...
}
case FBSessionStateClosedLoginFailed:
{
...
}
default:
break;
}
}
}];
}
The above works fine for login. But, when I log out using the following code
[FBSession.activeSession closeAndClearTokenInformation];
this again calls the completionHandler of openActiveSessionWithReadPermissions:permissions allowLoginUI:. That does not make sense to me. I do not think it is the right behavior. Has anyone seen this problem? How do we log-out? I am using SDK 3.5 on iOS6.