Using the code from Facebook I have implemented
- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
NSArray *permissions = [[NSArray alloc] initWithObjects:
@"publish_actions",
nil];
return [FBSession openActiveSessionWithPermissions:permissions
allowLoginUI:allowLoginUI
completionHandler:^(FBSession *session,
FBSessionState state,
NSError *error) {
NSLog(@"error %@", error);
[self sessionStateChanged:session
state:state
error:error];
}];
}
It returns NO which I understand because it's a first time login, and the loginUI works (it sends the user to FB and asks them to give permissions) and then returns but completionHandler block is never ever run. It just returns to the app and nada.
I assume you following Implement the Login Flow of Facebook SDK but worth reading that section again as it explains everything. Make sure that you handled openURL and handleOpenURL methods in delegate. Also check openSessionWithAllowLoginUI almost always returns NO
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