Take the 2-minute tour ×

I have 2 iOS apps using the same Facebook APP ID.

The first works great with the new native Facebook Login.

While integrating with the paid version, I was following this guide to share app ID between both apps.

The problem: For some reason the following code isn't using the native Facebook login, but opens Safari for a web login instead.

BOOL result = NO;

FBSession *session = [[FBSession alloc] initWithAppID:nil

if (allowLoginUI || (session.state == FBSessionStateCreatedTokenLoaded)) {
    [FBSession setActiveSession:session];
    [session openWithCompletionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
         [self sessionStateChanged:session state:state error:error];
    result = session.isOpen;

return result;

I was double checking that I was logged in with my Facebook account at the iPhone's settings window.

No clue at Facebook docs about this.

Have they released an unfinished/bugged SDK?

share|improve this question

1 Answer 1

I think you need to use the openWithBehavior:completionHandler: variant for opening the session and explicitly specify FBSessionLoginBehaviorUseSystemAccountIfPresent for the behavior.

share|improve this answer

Your Answer


