我正在使用 FBConnct 实现 Facebook 集成,它工作正常,但是当我想从 Facebook 注销时它不起作用。
我的代码如下:
- (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];
}