title: Facebook Login Dialog does not work on iOS6 simulator
body: <p>I have been converting my application from the old Facebook SDK to the new Facebook SDK 3.1 in order to use the iOS6 native functionality as well as other Facebook functionality, and I am having a problem that happens consistently on the simulator and rarely on the device. </p>
  
  <p>When I go to log into Facebook, instead of the app backgrounding and authenticating through Safari or the Facebook app, I get a modal window on top of my app for the login (I believe this started with iOS6, even before switching to Facebook SDK 3.0/3.1). This window allows me to enter username and password, but when I go to click "Okay" in the upper right to authenticate, nothing happens. No callback occurs to the application:openURL:sourceApplication:annotation: in the AppDelegate.</p>
  
  <p><img src="https://i.imgur.com/MvPyy.png" alt="Facebook Login"></p>
  
  <p>In my shared FacebookController code (which I use for multiple projects), I am initializing the FBSession when attempting to authorize as per Facebook's sample code:</p>
  
  <pre><code>FBSession *session = [[FBSession alloc] initWithAppID:nil permissions:readPermissions defaultAudience:FBSessionDefaultAudienceNone urlSchemeSuffix:self.fbUrlSchemeSuffix tokenCacheStrategy:nil];
  
  if(session.state == FBSessionStateCreated || session.state == FBSessionStateCreatedTokenLoaded)
  {
    [FBSession setActiveSession:session];
  
    // we open after the fact, in order to avoid overlapping close
    // and open handler calls for blocks
    [session openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
  ...
  </code></pre>
  
  <p>The code for the completion handler is never executed unless I click the x cancel button on the dialog (in which case I get an error as expected).</p>
  
  <p>I am setting the FacebookAppID in my iOS target properties (info.plist) and I have the URL Schemes set up with fb###[url_scheme_suffix] as well.</p>
  
  <p>The only difference I have between my code and the Facebook sample code is that I am using url scheme suffixes as I have a free and paid version of our app.</p>
  
  <p>If the app uses Safari to log in, it works with the code as given. If it fast-switches to the Facebook app, it also works. Additionally, the shared facebook ios6 account settings work. The app only fails if it uses the in app modal.</p>
  
  <p>Has anyone else encountered this?</p>