How to keep Facebook Session Alive

The key is set up the AppDelegate file correctly.

This discussion on stackoverflow offers a simple and clean sample.

(the sample appDelegeate inside is correct, the user has an error because he made repetitive calls to openSessionWithAllowLoginUI)

The important part is call

[self openSessionWithAllowLoginUI:YES];


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

Additionally, In

- (void)applicationWillTerminate:(UIApplication *)application {...}

Make sure you have

//[FBSession.activeSession close];

comment out.

This entry was posted in Facebook API, IPhone App Development. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s