I converted my application from the old Facebook SDK to the new Facebook SDK 3.1 in order to use iOS6's own functionality, as well as other Facebook features, and I have a problem that constantly repeats on the simulator and rarely on the Device.
When I go to Facebook on Facebook, instead of connecting to applications and checking them through Safari or the Facebook application, I get a modal window on top of my login application (I believe it started with iOS6, even before switching to Facebook SDK 3.0 /3.1). This window allows me to enter a username and password, but when I go to click "OK" in the upper right corner for authentication, nothing happens. The callback does not apply to the application: openURL: sourceApplication: annotation: in AppDelegate.

In my common FacebookController code (which I use for several projects), I initialize FBSession when I try to log in according to the Facebook code sample:
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) { ...
The completion handler code never executes unless I click the x cancel button in the dialog box (in this case, I get an error as expected).
I set FacebookAppID in my iOS target properties (info.plist) and I have URL schemes configured with fb ### [url_scheme_suffix].
The only difference I have between my code and the Facebook code sample is that I use URL scheme suffixes, as I have a free and paid version of our application.
If the application uses Safari to log in, it works with the specified code. If he quickly switches to the Facebook app, it also works. In addition, the general settings of the facebook ios6 account work. An application works only if it is used in a modal application.
Has anyone else come across this?