Opening FBSession in consecutive launches (FB SDK for SDK 3.0)

Viewed 20151

I am trying to integrate the new Facebook SDK for iOS and had a problem understanding some concepts.

  1. I authenticate using [FBSession sessionOpenWithPermissions:...] auth dialog comes up and I return the app. Auth successful.

  2. Then shut down the app, relaunch again. [[FBSession activeSession] accessToken] successfully returns previously saved token.

  3. However, at the same time, [[FBSession activeSession] isOpen] returns NO. (This means session is not ready for use.)

  4. Also, [[FBSession activeSession] state] is FBSessionStateCreatedTokenLoaded at this time. Tutorial here uses isOpen call to verify active session is loaded and opened with token.

So what do we call to open the token-loaded session without redirecting user to auth dialog?

Hints:

In FBSessionState enum, for FBSessionStateOpen it says:

Open session state indicating user has logged in or a cached token is available.

However FBSessionStateCreatedTokenLoaded is described as:

One of two initial session states indicating that a cached token was loaded; when a session is in this state, a call to open* will result in an open session, without UX or app-switching

Could you please help me figure out understanding these session transitions?

5 Answers
Related