I am trying to logout from Facebook programmatically without using FBSDKLoginButton
i had search how could I do
i found this answer Can we logout facebook pro
FBSDKLoginManager is your need, it has logOut
method but you might have to use your custom login
e.g.
FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init];
[loginManager logInWithReadPermissions:@[@"email"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if (error) {
// Process error
} else if (result.isCancelled) {
// Handle cancellations
} else {
// If you ask for multiple permissions at once, you
// should check if specific permissions missing
if ([result.grantedPermissions containsObject:@"email"]) {
// Do work
}
}
}];
//then logout
[loginManager logOut];