Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

facebook connect on iPhone - making calls is giving error 102 "Session key invalid or no longer valid", yet the stream dialogs still work

Anyone see this?
I've a situation whereby sometimes, [session resume] returns YES. I make a FBRequest.call, and the error delegate gets called. The error has 102 "Session key invalid or no longer valid". However, if within the same session I call up any FBDialogs (e.gr. to publish to a stream), these all work fine. I don't see why they are not suffering the same error.

Any ideas?

Yes. I know there's a forum for facebook connect, but its taking an age to get my password sent to me. (Yes...there's an irony there - why didn't they just use facebook connect for their forums...ho hum).

like image 604
dermdaly Avatar asked Nov 15 '22 12:11

dermdaly


1 Answers

- (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 of that method, I don't think that the code is trying to make the connection with facebook to test, they just get the expiration date. I think that sometimes, when you logout of facebook, the session does not expire but on server side, they delete your session

like image 66
vodkhang Avatar answered Jan 01 '23 09:01

vodkhang