Facebook signup IOS parse

1

Good afternoon: When he managed to signup and login with Facebook he saved me the id in Parse but he did not save the email of the user used from Facebook to register. He used oauth in Parse server but I do not know why the email does not appear in it despite giving email permissions in his creation. Law permission = [email] What is the problem? Thanks

    
asked by Sebas Martin Balbuena 22.02.2017 в 23:12
source

1 answer

0

I leave here the whole process, it is just as I do it in my applications:

- (void)loginFB {
    FBSDKLoginManager *login = [[FBSDKLoginManager alloc]init];
    [login logInWithReadPermissions:@[@"public_profile", @"email"]fromViewController:self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
        if (!error) {
            [[[FBSDKGraphRequest alloc]initWithGraphPath:@"me" parameters:@{@"fields":@"id,name,email"}]startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
                if (!error) {
                    // GUARDAR DATOS
                    NSString *userID    = result[@"id"];
                    NSString *userName  = result[@"name"];
                    NSString *userEmail = result[@"email"];
                }
            }];
        }
    }];
}

First I log in with "FBSDKGraphRequest" asking for the permissions and if the user accepts them, I make the request of the data I want with "FBSDKGraphRequest" and once obtained the passwords to their variables, which you already keep in your database. data.

I hope it serves you.

    
answered by 28.02.2017 в 18:34