Hassan Aftab Hassan Aftab - 1 year ago 438
iOS Question

(com.facebook.sdk.login error 304.) Error with FBSDK 4.2

I am trying to implement login with Facebook functionality, But I am getting following error in return.

Login Failed with error: The operation couldn’t be completed.
(com.facebook.sdk.login error 304.)

Here is my Code

- (void)loginWithFacebook {
NSString *const read_actions = @"email";

[[[FBSDKLoginManager alloc] init]
logInWithReadPermissions:@[read_actions] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error)
if (error) {
NSLog(@"Login Failed with error: %@", error.localizedDescription);
else if (result.isCancelled)
NSLog(@"Login Failed due to Cancel");
if ([result.grantedPermissions containsObject:read_actions]) {
NSLog(@"Permission granted");


Answer Source

It seems I was doing

[FBSDKAccessToken refreshCurrentAccessToken:^(FBSDKGraphRequestConnection *connection, id result, NSError *error){}

in a background thread during login operation. I removed that and It worked perfectly fine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download