1

I tried [[FBSDKLoginManager new] logOut]; and

if ([FBSDKAccessToken currentAccessToken]) {
        [FBSDKAccessToken setCurrentAccessToken:nil];
        [FBSDKProfile setCurrentProfile:nil];
    }

and this as well as

FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];

    if ( [FBSDKAccessToken currentAccessToken] ){
        [login logOut];
    }

but logout is not work ...any help will be appreciable Thank you..

iAhmed
  • 6,556
  • 2
  • 25
  • 31
objectiveCoder
  • 579
  • 5
  • 17
  • possible duplicate of [Logout from Facebook programmatically iOS](http://stackoverflow.com/questions/29623191/logout-from-facebook-programmatically-ios) – streem Jul 06 '15 at 11:32
  • How do you know logout doesn't work ? If you set a breakpoint do you go through the "if" every time ? – streem Jul 06 '15 at 11:36
  • yes but still when i go back it gives me logging results – objectiveCoder Jul 06 '15 at 11:37

2 Answers2

1

[FBSDKAccessToken setCurrentAccessToken:nil]; // write this code on logout button click and after that navigate to it's rootview controller or your initial view Controller

objectiveCoder
  • 579
  • 5
  • 17
0

Swift version

import FBSDKLoginKit

FBSDKLoginManager().logOut()

Using FBSDK

#import <FBSDKLoginKit/FBSDKLoginManager.h>

then use this code to logout.

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

hope this will help....

Subhash Khimani
  • 427
  • 7
  • 22