I am implementing Facebook integration using FBConnct and it works fine but when I want to log out from the Facebook it doesn't work.
My code is as follows:
- (IBAction)logOutbuttonPressed:(id)sender {
[Facebook logout:self];
}
- (void)fbDidLogout {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults removeObjectForKey:@"FBAccessTokenKey"];
[defaults removeObjectForKey:@"FBExpirationDateKey"];
NSLog(@" after %@",facebook.accessToken);
NSLog(@" date%@",facebook.expirationDate);
[defaults synchronize];
}
- (void)logout:(id<FBSessionDelegate>)delegate {
[self logout];
if (delegate != self.sessionDelegate &&
[delegate respondsToSelector:@selector(fbDidLogout)]) {
[delegate fbDidLogout];
}
Call this method to logout from facebook.
You need to implement this code for facebook logout as well
Try this import 'FBConnect.h' in ur second view controller
then .......