App running in background (using FBConnect)


I’m trying to use the latest FBConnect within my app but having problems with my app closing in the background.
Once I call [facebook authorize:_permissions delegate:self] from my app, FBConnect goes on to detect that multitasking is supported and calls [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fbAppUrl]].

This seems to background my app and presents a fackbook login screen, however my app always closes at this point. Is there something I must adapt in my app to support backgrounding?

Or could it be something to do with the fact that I don’t appear to be catching
-(BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
It’s my understanding that by calling ofxiPhoneAlerts.addListener(this) in the setup() of my main class,
launchedWithURL(string url) (which is implemented in my main class too) should be called when i launch a url, but it never is…

Base SDK is set to iOS 4.3
iOS Deployment Target is set to iOS 4.0

Hope someone can help.


Not sure if this is why, but check your plist and make sure that UIApplicationExitsOnSuspend is checked off. When it’s on, the app exits entirely when it goes to the background.

1 Like

That was it!



Hey, I tried changing this setting, but still doesn’t return to my app.

I’m using OF 007, iOS 5.1, and I’m attempting to Facebook iOS SDK following this tutorial:

I’ve modified the offiPhoneAppDelegate to use FBSessionDelegate and implemented functions for it. It launches the FB Login (like mhax), but it seems openURL never gets called.

My app is still running in the background, just doesn’t seem like it ever gets a callback from Facebook.

Any ideas?


Seems whenever I post here, I end up finding the answer on google mere minutes later. I should post here earlier and save my self a couple hours :slight_smile:

The problem was I didn’t include “fb” in front of my Facebook App Id in my p_list.

Sorry to bump an old thread but I’m desperate to post an image onto Facebook from my OF iOS app. Please could someone give me a pointer as to where to start? Can it be done from the empty example or do we need iOS guy integrated?

Please could you possibly post a example of this working? This is very exciting
Many thanks in advance!


Nice post and i think you got your answer.

FYI, I managed to set up socialize within my app.
Now posting photos to facebook :slight_smile:

I basically followed their step by step tutorial and skipped the bit where you integrate the toolbar, and post the picture directly in code. I’d be happy to help with that