Take the 2-minute tour ×

Using the code from Facebook I have implemented

- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
    NSArray *permissions = [[NSArray alloc] initWithObjects:

    return [FBSession openActiveSessionWithPermissions:permissions
                                 completionHandler:^(FBSession *session,
                                                     FBSessionState state,
                                                     NSError *error) {
   NSLog(@"error %@", error);                                     
    [self sessionStateChanged:session

It returns NO which I understand because it's a first time login, and the loginUI works (it sends the user to FB and asks them to give permissions) and then returns but completionHandler block is never ever run. It just returns to the app and nada.

share|improve this question
add comment

3 Answers

Little late, but just in case someone comes checking...

Switching from openActiveSession to the instance method openWithCompletionHandler did the trick for me.

share|improve this answer
add comment

from the official doc


... If a block is provided, the FBSession object will call the block each time the session changes state.

I fixed this problem my solving Open Graph setups and by studying Scrumptious example code from FB such as these functions [FBSession.activeSession handleOpenURL:url] and [FBSession.activeSession handleDidBecomeActive];

share|improve this answer
add comment

I assume you following Implement the Login Flow of Facebook SDK but worth reading that section again as it explains everything. Make sure that you handled openURL and handleOpenURL methods in delegate. Also check openSessionWithAllowLoginUI almost always returns NO

share|improve this answer
Sure did. Copied it all. –  Will Larche Sep 20 '12 at 15:28
add comment

Your Answer


