Msencenb Msencenb - 5 months ago 31
iOS Question

Manually clear facebook token in Facebook Login 4.4 for iOS

Using facebook login version 2.4, with the FacebookCoreSDK iOS 4.4. Seems like version 4 has removed all manual session management features. The app I'm working on has a logout feature in which I would like to manually clear out the facebook access token.

Previously in 3.x I could do it like this:

[FBSession.activeSession closeAndClearTokenInformation];


I can't find an equivalent in 4.x.... any ideas?

Answer

You can use FBSDKLoginManager logOut method.

This calls [FBSDKAccessToken setCurrentAccessToken:nil] and [FBSDKProfile setCurrentProfile:nil].

reference:

https://developers.facebook.com/docs/reference/ios/current/class/FBSDKLoginManager/

example:

[[FBSDKLoginManager new] logOut];