Parse login with Facebook does not work

依然范特西╮ 提交于 2020-01-04 09:37:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!