Hi this returns a state of FBSessionStateClosedLoginFailed every time I run it. I've checked my bundle name, URL setting etc and all cool. In fact face book knows i've authenticated against the app. However ever time I call openWithCompletion my session fails !!
     [appDelegate.session openWithCompletionHandler:^(FBSession *session,
                                                     FBSessionState status,
                                                     NSError *error) {
        switch (status) {
            case FBSessionStateOpen:
                NSLog (@"Open");
                break;
            case FBSessionStateClosed:
                NSLog (@"Closed");
                break;
            case FBSessionStateClosedLoginFailed:
                NSLog (@"Failed");
                break;
            default:
                break;
        }
        [self updateView];
    }];
I have created this in the app delegate that also get called successfully, but always returns false:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    return [FBSession.activeSession handleOpenURL:url];
}
Did you try this in your app delegate:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
    return [FBSession.activeSession handleOpenURL:url];
}
I had a similar issue got it fixed here
OK how weird. I took the FB SDK login example used my FB app code and bundle ID and it worked. I then reran mine and it worked ? Maybe FB server replication took a bit of time ? No idea but it goes now ....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With