Facebook connect on iPhone - the call causes error 102 "Session key is invalid or is already invalid", but the flow dialogs still work

Does anyone see this? I have a situation where sometimes [resuming session] returns YES. I am doing FBRequest.call and the error delegate is being called. Error has 102 "Session key is invalid or no longer valid." However, if during one session I call any FBDialogs (e.g.r. to publish to the stream), they all work fine. I do not understand why they do not tolerate the same error.

Any ideas?

Yes. I know that there is a forum for connecting to facebook, but it takes age to get my password sent to me. (Yes ... there is an irony - why they just did not use facebook for their forums ... ho hum).

+5
source share
1 answer
- (BOOL)resume {
  NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  FBUID uid = [[defaults objectForKey:@"FBUserId"] longLongValue];
  if (uid) {
    NSDate* expirationDate = [defaults objectForKey:@"FBSessionExpires"];
    if (!expirationDate || [expirationDate timeIntervalSinceNow] > 0) {
      _uid = uid;
      _sessionKey = [[defaults stringForKey:@"FBSessionKey"] copy];
      _sessionSecret = [[defaults stringForKey:@"FBSessionSecret"] copy];
      _expirationDate = [expirationDate retain];

      for (id<FBSessionDelegate> delegate in _delegates) {
        [delegate session:self didLogin:_uid];
      }
      return YES;
    }
  }
  return NO;
}

Here is the code for this method, I don’t think the code is trying to connect to Facebook to check, they just get an expiration date. I think that sometimes when you log out of facebook, the session does not expire, but on the server side they delete the session

+1
source

All Articles