Ios – Facebook login using Parse not working

facebookiosobjective cparse-platform

I am trying to use Parses SDK to make the single sign on for Facebook but when I press the login button I get this error:

Uh oh. An error occurred: Error Domain=com.facebook.sdk Code=2 "The
operation couldn’t be completed. (com.facebook.sdk error 2.)"
UserInfo=0x1d5bac20
{com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:SystemLoginDisallowedWithoutError,
com.facebook.sdk:ErrorSessionKey=,
expirationDate: (null), refreshDate: (null), attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(null)>}

The code when I hit the button is almost the same as in Parse's tutorial

- (IBAction)loginButtonTouchHandler {
    // The permissions requested from the user
    NSArray *permissionsArray = @[ @"user_about_me", @"user_birthday"];

    // Login PFUser using Facebook
    [PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) {
        [_activityIndicator stopAnimating]; // Hide loading indicator

        if (!user) {
            if (!error) {
                NSLog(@"Uh oh. The user cancelled the Facebook login.");
            } else {
                NSLog(@"Uh oh. An error occurred: %@", error);
            }
        } else if (user.isNew) {
            NSLog(@"User with facebook signed up and logged in!");
        } else {
            NSLog(@"User with facebook logged in!");
        }
    }];
}

I have my facebook app all set and everything.

Any leads?

Best Answer

I had the same problem on my device. Same error.

Fix was simple: Settings -> Privacy -> Facebook -> and check your app status there.

Related Topic