You are probably faced with this situation. This is really frustrating.
Facebook iOS SDK does not save cookies for access
You can, if you want, force the iOS library to use your application to log in and allow the local application through UIWebview. This way you are logged in and use cookies. You will need to add the method to an existing Facebook object. Usually you call:
- (void) authorize:(NSArray *)permissions delegate:(id<FBSessionDelegate>)delegate
for authorization, which in turn calls a private method:
- (void)authorizeWithFBAppAuth:(BOOL)tryFBAppAuth safariAuth:(BOOL)trySafariAuth
both parameters are set to YES.
You want to add a public method that calls the same private function, but with both parameters set to NO. I added this method to Facebook.m and declared it on Facebook.h so that I can name it, but I like:
- (void)authorize:(NSArray *)permissions tryFBApp:(BOOL) tryFBApp trySafariAuth:(BOOL) trySafariAuth delegate:(id<FBSessionDelegate>)delegate { [_permissions release]; _permissions = [permissions retain]; _sessionDelegate = delegate; [self authorizeWithFBAppAuth:tryFBApp safariAuth:trySafariAuth]; }
I call this with two BOOL parameters set to NO, and a local UIWebView appears in the library, which leaves me with cookies that work for the application.
source share