Ahd Radwan Ahd Radwan - 2 months ago 48
iOS Question

Logout from Facebook programmatically iOS

I am trying to logout from Facebook programmatically without using


i had search how could I do
i found this answer Can we logout facebook programatically
but the problem is the
is deprecated in new iOS FBSDK version

my question is
Is there any way to clear the fb session in the new iOS FBSDK version? if there any way to logout from Facebook programmatically?
or how could I call the logout action from

Thanking in advance


You have two methods to logout. First, as suggested by Inder Kumar Rathore

FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init];
[loginManager logOut];

Second is by setting the currentAccessToken to nil

[FBSDKAccessToken setCurrentAccessToken:nil];

@cookiemonsta hope second method works for you.