Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are likely running into this situation. It's really frustrating.</p> <p><a href="http://facebook.stackoverflow.com/questions/6964721/facebook-ios-sdk-not-storing-cookies-for-access/7124238#7124238">Facebook iOS SDK not storing cookies for access</a></p> <p>You can, if you want, force the iOS library to use your app for login, and authorize through a UIWebview local to your app. You are thus logged in, and have cookies to use. You'll have to add a method to the existing Facebook object. Normally, you call:</p> <pre><code>- (void) authorize:(NSArray *)permissions delegate:(id&lt;FBSessionDelegate&gt;)delegate </code></pre> <p>to authorize, which in turns calls the private method:</p> <pre><code>- (void)authorizeWithFBAppAuth:(BOOL)tryFBAppAuth safariAuth:(BOOL)trySafariAuth </code></pre> <p>with both parameters set to YES.</p> <p>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 in Facebook.h so I could call it however I like:</p> <pre><code>- (void)authorize:(NSArray *)permissions tryFBApp:(BOOL) tryFBApp trySafariAuth:(BOOL) trySafariAuth delegate:(id&lt;FBSessionDelegate&gt;)delegate { [_permissions release]; _permissions = [permissions retain]; _sessionDelegate = delegate; [self authorizeWithFBAppAuth:tryFBApp safariAuth:trySafariAuth]; } </code></pre> <p>I call that with the two BOOL parameters set to NO, and the library pops ups a local UIWebView that leaves me with cookies that work for the app.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload