The FBSessionDelegate protocol defines the methods that a delegate of a
The protocol declares methods that are implemented by your application to handle session callbacks during user authentication and permissions authorization. All the methods defined in this protocol are required.
You should implement the methods to handle one or more of the following scenarios:
User successfully logs in.
User successfully logs out.
User dismisses the authorization dialog during the login process.
An error occurs during the authorization process.
access_token has been refreshed.
The current user session has expired during an API call.
Sent to the delegate when the user successfully logs in.
You will want to handle any post-login set up in your implementation. For example you could store the user's
access_token in persistent storage.
Sent to the delegate when there is an error during authorization or if the user dismissed the dialog without logging in.
cancelled - If the authorization failed due to user action.
You will want to handle the authorization dismissals and failures in your implementation.
Sent to the delegate when the user logged out.
You will want to handle any post-logout set up in your implementation. For example, you could remove the user's
access_token from persistent storage if you previously stored this upon successful login.
Sent to the delegate when the access token is extended.
- (void)fbDidExtendToken:(NSString*)accessToken expiresAt:(NSDate*)expiresAt;
accessToken - The extended
expiresAt - The updated expiration date.
Implement this method to refresh any previously stored
access_token in your app. For example, if you stored the session information in persistent storage you will need to update that information.
Sent to the delegate when Facebook Platform is invoked and the current user session has expired.
You could implement this method and perhaps alert the user then invite them to re-authenticate your app.