Facebook Connect iPhone API logout not working

Posted by Hunter Bridges on Stack Overflow See other posts from Stack Overflow or by Hunter Bridges
Published on 2010-05-18T18:59:37Z Indexed on 2010/05/18 19:00 UTC
Read the original article Hit count: 459

Filed under:
|
|

I am attempting to write a Facebook integration in an iPhone app I'm working on. I have it logging in just fine, but I don't like the idea of being able to turn a feature on without being able to turn it off. So, in working on the logout functionality, I have been caught in a snag.

- (IBAction) logoutClicked:(id)sender {
    if (fbLoggedIn)
    {
        FBSession * mySession = [FBSession session];

        [mySession logout];
    }
}

- (void)sessionDidLogout:(FBSession*)session
{
    NSLog(@"Session logged out.");
    [theLoginButton setTitle:@"Facebook Time!" forState:UIControlStateNormal];
    fbLoggedIn = FALSE;
    theLogoutButton.enabled = NO;
    theLogoutButton.alpha = 0;
}

The logoutClicked method responds to a button in my xib. The delegate method is not getting called. I have tried setting the Facebook session as a property in my ViewController in order to store/access the data across methods, but that didn't seem to work either. Anybody have any solutions?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c