title: Facebook App Login: Is it possible to catch 'cancelButtonPressed' event?
body: <p>Is it possible to catch event <strong>'CancelButtonPressed'</strong> in <code>Facebook App</code> through <code>facebook-ios-sdk</code> authorization flow?</p>
  
  <p>I use pretty old version of <code>Facebook SDK for IOS</code> and open session like this:</p>
  
  <pre><code>[_facebookSession openWithBehavior:FBSessionLoginBehaviorWithNoFallbackToWebView
                               completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
                  NSLog(@"this is FBSession State: %d",status);
                  NSLog(@"this is NSError: %@",error);
                  NSLog(@"create new session with permissions: %@",_facebookSession.permissions);
              }];
  </code></pre>
  
  <p>I saw <a href="http://facebook.stackoverflow.com/questions/12684428/how-to-return-to-app-if-user-cancel-facebook-login">this</a> question, but maybe something changed in <code>Facebook IOS SDK</code>?</p>
  
  <p>Maybe somebody knows answer or good solution? </p>
  
  <p>Thanks for help!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>if ([_facebookSession state]==FBSessionStateCreatedOpening){
      // if we call FBApp, facebook session will be in this state (createdOpening)
      // and we need to check it and close, to recall FBApp
      [_facebookSession closeAndClearTokenInformation];
      // and now recrate session and open it ;)
      _facebookSession = [[FBSession alloc] initWithAppID:kAppId
                                                      permissions:permissions
                                                  urlSchemeSuffix:nil
                                               tokenCacheStrategy:[FBSessionTokenCachingStrategy defaultInstance]
                                  ];
  
      //and reopen it like `[_facebookSession openWith... ];`
  }
  </code></pre>