Search code examples
iosfacebookfacebook-logingigya

Gigya facebook login: completion handler not called


I´m trying to use Gigya-SDK to login in the app via facebook. The setup up on Facebook looks good and the native facebbook login without Gigya works fine. But when I call the Gigya method the completion handler after the successful login on the Facebook- Website is never be called.

Here is my very simple code:

 [Gigya showLoginProvidersDialogOver:self providers:providers parameters:nil     
                        completionHandler:^(GSUser *user, NSError *error) {
    if (!error) {
         NSLog(@"works");
    }
    else {
         NSLog(@"Error: %@", error.userInfo);
        // If the login was canceled by the user - do nothing. Otherwise, display an 
           error.
        if (error.code != GSErrorCanceledByUser) {
            NSLog(@"Error: %@", error.userInfo);
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                            message:@"An error has  
occured. Please try again later"
                                                           delegate:nil
                                                  cancelButtonTitle:@"OK"
                                                  otherButtonTitles:nil];
            [alert show];
        }
    }
}];
  • iOS SDK: 8.1
  • Facebbok-SDK: 3.20
  • Gigya-SDK : 3.0.6

Solution

  • After a few attempts I have the solution that has helped me.

     [Gigya  initWithAPIKey:@"-----------------" APIDomain:@"eu1.gigya.com"];
    

    I had to put the correct APIDomain. The docs of Gigya refers only to

    [Gigya  initWithAPIKey:@"-----------------"];
    

    which was using US domain by default.