It's clear to me that these are called upon login if a user grants or denials permission:
- (void)fbDidLogin;
- (void)fbDidNotLogin:(BOOL)cancelled;
But i was wondering when the following FBSessionDelegate methods could be called:
- (void)fbDidExtendToken:(NSString*)accessToken expiresAt:(NSDate*)expiresAt;
- (void)fbDidLogout;
- (void)fbSessionInvalidated;
The documentation says:
//Called after the access token was extended.
- (void)fbDidExtendToken:(NSString*)accessToken expiresAt:(NSDate*)expiresAt;
//Called when the user logged out.
- (void)fbDidLogout;
//Called when the current session has expired.
- (void)fbSessionInvalidated;
Now when would such a thing happen? When i call the following?
[Facebook authorize:nil];
There is no chance i will get a fbDidLogout call back right?
Maybe if a user removes my app from his Facebook account via the Facebook app, would this method be called than? No, because my app doesn't open in that case..
...so in which situation would these be called?
I think i found it myself...
This one:
- (void)fbDidExtendToken:(NSString*)accessToken expiresAt:(NSDate*)expiresAt;
Could be called when you call:
[facebook extendAccessTokenIfNeeded];
This one:
- (void) fbDidLogout;
Gets called when you call
[facebook logout] //(of course..)
The last one:
- (void)fbSessionInvalidated;
Get's called when you try to send a http request to Facebook with an expired session token.
I found it in the Facebook SDK header file Facebook.m
I'll leave the question here for anyone looking for the answer :)