title: iOS Facebook login doesn't work
body: <p>I have an app, for iOS5 and above, in which I am trying to set up Facebook login. All works fine when there is a Facebook account integrated in the phone. If it is not, it doesn't work. This is even if the Facebook app is installed. </p>
  
  <p>When the app is installed, it opens the app, asks me permission to access the appropriate user data and returns to my app with no result. It the same when it isn't installed. Safari is opened, asks me for authorization, returns, and nothing. </p>
  
  <p>I followed all the steps mentioned in the Facebook Login tutorial. Is this a problem only I am facing?</p>
  
  <p>EDIT: This is the requested code:</p>
  
  <p>I open a session like so:</p>
  
  <pre><code>- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
  
      NSArray *permissions = [[NSArray alloc] initWithObjects:
                          @"email",
                          nil];
  
      return [FBSession openActiveSessionWithReadPermissions:permissions
                                            allowLoginUI:allowLoginUI
                                       completionHandler:^(FBSession *session,
                                                           FBSessionState state,
                                                           NSError *error) {
                                           [self sessionStateChanged:session
                                                               state:state
                                                               error:error];
                                       }];
  }
  </code></pre>
  
  <p>And when it returns, I guess this method must be called. but it isn't:</p>
  
  <pre><code>- (void)sessionStateChanged:(FBSession *)session
                    state:(FBSessionState) state
                    error:(NSError *)error
  {
  
      switch (state) {
          case FBSessionStateOpen:
              if (!error) {
                  // We have a valid session
                  NSLog(@"session opened");
                  FBRequest *me = [FBRequest requestForMe];
                  __block NSString *username = nil;
  
                  [me startWithCompletionHandler:^(FBRequestConnection *connection,
                                               id result,
                                               NSError *error) {
                      NSDictionary&lt;FBGraphUser&gt; *my = (NSDictionary&lt;FBGraphUser&gt; *) result;
                    //  NSLog(@"User session found: %@", my.username);
                      username = my.username;
                  }];
  
              // /fb_access/:access_token
  
          }
          break;
      case FBSessionStateClosed:
  
          if (!error) {
              // We have a valid session
              NSLog(@"User session closed");
  
          }
  
      case FBSessionStateClosedLoginFailed:
           NSLog(@"login failed, %@", error);
          [FBSession.activeSession closeAndClearTokenInformation];
          break;
      default:
          break;
  }
  
  [[NSNotificationCenter defaultCenter]
   postNotificationName:FBSessionStateChangedNotification
   object:session];
  
  if (error) {
      UIAlertView *alertView = [[UIAlertView alloc]
                                initWithTitle:@"Error"
                                message:error.localizedDescription
                                delegate:nil
                                cancelButtonTitle:@"OK"
                                otherButtonTitles:nil];
      [alertView show];
  }
  }
  </code></pre>
  
  <p>Any ideas?</p>