Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In which situation are those Facebook IOS FBSessionDelegate methods called?

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?

like image 989
Tieme Avatar asked Dec 01 '25 22:12

Tieme


1 Answers

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 :)

like image 125
Tieme Avatar answered Dec 03 '25 12:12

Tieme



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!