7

i'm trying to make login in Quickblox app via Facebook SDK But I get 422 error.

I've done all things that need in Quikblox, Facebook and iOS app

  1. Created Facebook app and integrated SDK to iOS app.
  2. I Filled up all required fields in Quickblox admin

I verified token here

-(IBAction)test:(id)sender {
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
[login logInWithReadPermissions:@[@"email"]
             fromViewController:self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {

    if (error) {
        // Process error
    }
    else if (result.isCancelled) {
        // Handle cancellations
    }
    else {
        if ([result.grantedPermissions containsObject:@"email"])
        {
            NSLog(@"result is:%@",result.token.tokenString);
            [QBRequest logInWithSocialProvider:@"facebook" accessToken:result.token.tokenString
                             accessTokenSecret:nil
                                  successBlock:^(QBResponse *response, QBUUser *user) {
                // Login succeded
            } errorBlock:^(QBResponse *response) {
                // Handle error
            }];
        }
    }
}];
}

also I tried with QMServicesManager

    [[[QMServicesManager instance]authService]logInWithFacebookSessionToken:[FBSDKAccessToken currentAccessToken].tokenString completion:^(QBResponse *response, QBUUser *userProfile) {

}];

Here my logs

Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
Rinat
  • 111
  • 3

1 Answers1

0

Your facebook token does not return email address, this is required for quickblox to successfully register user and log it in.

Raikerian
  • 552
  • 2
  • 7
  • Could you help me with this issue, Do I need set some options in facebook app?Or is problem with code? I've downloaded q-municate app from github and I've noticed that in the app has same permitions etc. – Rinat Dec 19 '15 at 14:33
  • When you are accepting login in facebook dialog, there is permissions the first time. You can restrict email there. For the next time you need to correct your permissions on facebook site to allow your app receive such information. – Raikerian Dec 22 '15 at 13:54