Reputation: 49
I have integrated the facebook sdk into my ios app but want to create a custom logout button as i think the uiview logout button the sdk provides does not fit my color scheme. does anyone know how I can run a method to do a facebook logout?
I have tried the following code but it doesn't work
var theFBSession = FBSession.activeSession()
var check = FBSession.closeAndClearTokenInformation(theFBSession)
Upvotes: 5
Views: 7874
Reputation: 1487
Logout from Facebook Swift 5.0
let loginManager = LoginManager()
loginManager.logOut()
Upvotes: 0
Reputation: 9734
Logout from Facebook
let fbLoginManager = FBSDKLoginManager()
fbLoginManager.logOut()
Upvotes: 0
Reputation: 1104
For swift 3.0 add below code for logout
let loginManager = LoginManager()
loginManager.logOut()
Upvotes: 3
Reputation: 800
Facebook SDK 4.X with Swift
let loginManager = FBSDKLoginManager()
loginManager.logOut()
Upvotes: 12
Reputation: 17685
Maybe it's late, but try this :
FBSession.activeSession().closeAndClearTokenInformation()
I hope it will help
Upvotes: 1