I have facebook login in my iphone app using facebook sdk-3.1 .After login it will get in to my app and there I didnot give any logout button .so,when we click button login with facebook I will get the previous user facebook account .
Inorder to resolve this problem iam giving button logout.
how can I logout facebook programmatically on clicking button
am giving login like this
-(IBAction)Login:(id)sender
{
appDelegate = (AppDelegate *) [[UIApplication sharedApplication] delegate];
appDelegate.getActionForLoginbtn=@"LoginwithFB";
[appDelegate openSessionWithAllowLoginUI:YES];
}
-(BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI{
NSArray *permissions=[[NSArray alloc]initWithObjects:@"email", nil];
return[FBSession openActiveSessionWithReadPermissions:permissions allowLoginUI:allowLoginUI completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
[self sessionStateChanged:session state:state error:error];
}];
}