0

I'm trying to implement Facebook login with Parse and I get the following error message:

[Error]: Permission denied for this action. (Code: 119, Version: 1.14.2)

I have already added my application's Facebook Application ID to my Parse application's settings page, linked my app to the Facebook SDK, and added the FacebookAppID and URL Scheme values to my .plist file.

This is the code I'm using to try and login (directly from Parse). http://parseplatform.github.io/docs/ios/guide/#log-in--sign-up

NSArray *permission = [NSArray arrayWithObjects:@"public_profile", @"email", @"user_friends", nil];

[PFFacebookUtils logInInBackgroundWithReadPermissions:permission block:^(PFUser *user, NSError *error) {

    NSLog(@"Error: %@", error.description);
    if (user) {
        NSLog(@"Uh oh. The user cancelled the Facebook login.");
    } else if (user.isNew) {
        [self performSegueWithIdentifier:@"signInSuccessful" sender:nil];
        NSLog(@"User signed up and logged in through Facebook!");
    } else {
        [self performSegueWithIdentifier:@"signInSuccessful" sender:nil];
        NSLog(@"User logged in through Facebook!");
    }
}];
  • Are you being prompted to allow your app on Facebook ? – Ran Hassid Jul 31 '16 at 07:18
  • Yes! It shows me a summary screen of what fields the app is requesting and I approve them. Then, the next time I launch the app and the Facebook window comes up, it says the app is already authorized. When I go into my Facebook settings, I can see the app there. – Aryaman Sharda Jul 31 '16 at 17:16
  • Are you using parse.com service or parse-server (the open source)? – Ran Hassid Jul 31 '16 at 18:29
  • I'm using parser-server. I'm able to create and login with a conventional account (username and password) and am able to pull and save data elsewhere in the application, so I'm pretty sure the parse-server is setup correctly. – Aryaman Sharda Jul 31 '16 at 19:31
  • ok. did you add facebook as one of your oauth providers ? did you follow this guide: https://github.com/ParsePlatform/parse-server/wiki/OAuth ? – Ran Hassid Aug 01 '16 at 05:53

1 Answers1

0

what i found was that the logInInBackgroundWithReadPermissions method just wasn't working for some odd reason. You have to first get the token from Facebook using their standard method, then use the token info to login the user to your parse database. The below is a link to a solution for the problem answered in a related question.

https://stackoverflow.com/a/38936913/2472466

Community
  • 1
  • 1
t.ios
  • 1,024
  • 12
  • 18