3

I tried doing [FBSDKAccessToken setCurrentAccessToken:nil]; [FBSDKProfile setCurrentProfile:nil]; even after doing this and after running the application, I entered different credential to login to Facebook app, but it is still taking the previously entered credentials. So my question is how to clear or delete the credentials. Please someone help me in doing this. Thanks in advance for spending your time to go through this question and answering.

Rohit Khandelwal
  • 1,778
  • 15
  • 23
Sanjay H R
  • 33
  • 5

2 Answers2

1

try this

[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me/permissions/"
   parameters:nil
   HTTPMethod:@"DELETE"]
 startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id  result, NSError *error) {
  // ...
 }];

there after add your facebook login code

for additional information see this

or choice -2

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

if ( [FBSDKAccessToken currentAccessToken] ){
    [login logOut];
     [FBSDKAccessToken setCurrentAccessToken:nil];
    [FBSDKProfile setCurrentProfile:nil];
}
Community
  • 1
  • 1
Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
0

Yes, it will be because it took the cookies from the Safari browser.

Go to your Xcode --> Product --> clean --> and run it

or

Uninstall the app and go to Safari browser in your iPhone, hit the facebook.com if it's already signed in, hit log out, then run your application.

halfer
  • 19,824
  • 17
  • 99
  • 186
Vignesh
  • 592
  • 6
  • 25