问题
I recently implemented Parse login with facebook. I basically followed all the instructions to set up Facebook SDK and Parse SDK. So here is the part where the App throws out an exception:
NSArray *permissionArray=@[@"public_profile", @"email"]; [PFFacebookUtils logInWithPermissions:permissionArray block:^(PFUser *user, NSError *error) {
if (!user) {
NSLog(@"Uh oh. The user cancelled the Facebook login.");
} else if (user.isNew) {
NSLog(@"User signed up and logged in through Facebook!");
} else {
NSLog(@"User logged in through Facebook!");
}
The message that I am getting in the log screen is : "Uh oh. The user cancelled the Facebook login." so I assume that the Facebook session was not created and no user was returned. The interesting part here is that I tested this app on the iPhone 4 and the login worked. I am testing on iPhone 5 right now and this is when the exception gets thrown. Are there any settings that need to be right on the actual device? Is there a way I could triangulate the reasons for this issue?
Any help is greatly appreciated. Thank you
回答1:
Make sure it's in a button rather than ViewDidLoad, (or try to delay the code)
来源:https://stackoverflow.com/questions/26126952/parse-login-with-facebook-does-not-work