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.
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.

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:
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 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).
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.
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.
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.
Has anyone else encountered this?
nilas app ID in-initWithAppID:permissions...? - Kristofer Sommestad