I try to user Parse login using Facebook. Every time logInWithPermissions is used, the permissions are nil. The following code always produces the same output:
[PFFacebookUtils logInWithPermissions:[NSArray arrayWithObject:@"email"]
block:^(PFUser *user, NSError *error) {
NSLog(@"Initial login permissions: %@", [[PFFacebookUtils session] permissions]);
[PFFacebookUtils reauthorizeUser:[PFUser currentUser]
withPublishPermissions:[NSArray arrayWithObject:@"publish_actions"]
audience:FBSessionDefaultAudienceEveryone
block:^(BOOL succeeded, NSError *error) {
NSLog(@"Post request login permissions: %@", [[PFFacebookUtils session] permissions]);
[PFUser logOut];
}];
}];
The output is:
app2[6966:907] Initial login permissions: (null)
app2[6966:907] Post request login permissions: (
"user_location",
installed,
"user_birthday",
email,
"publish_actions"
)
Why are the initial permissions always nil? Shouldn't those permissions be retained between sessions? Right now every time the user logs out and then logs in again, the application asks for the same permissions that are already given to application previously.
Another strange thing is that logInWithPermissions:block uses default iOS6 dialog integrated into iOS, while reauthorizeUser:withPublishPermissions:audience:block switches the user into Facebook app.
I am using the following SDK versions:
And, of course, the question, as stated previously: Why are the initial permissions always nil? Shouldn't those permissions be retained between sessions?
The only suggestion I got from Parse is "use graph API":
https://parse.com/questions/pffacebookutils-loginwithpermissionsblock-loses-permissions
Though, the issue has been resolved in recent versions of Parse.