lundi 30 mars 2015

Unable to login via Facebook (Parse): error code 251

I have an app in the App Store which is using Parse and automatically creates anonymous users (I set [PFUser enableAutomaticUser]). So now I have several thousands of users in a Parse users table.


Now I'm trying to implement full profiles and convert anonymous users to non-anonymous by calling:



[PFFacebookUtils linkUser:currentUser permissions:@[@"public_profile", @"email", @"user_friends"] block:^(BOOL succeeded, NSError *error) {
if (succeeded) {
//some logic
} else {
NSLog(@"Error: %@", error);
}
}];


BTW I've also tried:



[PFFacebookUtils logInWithPermissions:@[@"public_profile", @"email", @"user_friends"] block:^(PFUser *user, NSError *error) {
if (!user) {
NSLog(@"Uh oh. The user cancelled the Facebook login.");
} else if (user.isNew) {
NSLog(@"User signed up through Facebook!");
} else {
NSLog(@"User logged in through Facebook!");
}
}];


But in both cases I get an error: 251 - The supplied Facebook session token is expired or invalid.


What I've already tried:



  • Logout anonymous user

  • Refresh session

  • Close and re-auth session


FB app settings


Nothing here works for me. Does anyone know what to do in this case? How do I correctly convert anonymous user to non-anonymous?


Aucun commentaire:

Enregistrer un commentaire