Gigya facebook login: completion handler not calle

2019-08-09 05:53发布

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

3条回答
一纸荒年 Trace。
2楼-- · 2019-08-09 06:11

What result do you get with this:

[Gigya loginToProvider:@"facebook"
parameters:nil
completionHandler:^(GSUser *user, NSError *error) {
    if (!error) {
        NSLog(@"works");
    }
    else {
        NSLog(@"error");
    }

}];

查看更多
Fickle 薄情
3楼-- · 2019-08-09 06:21

There are a few thing you will need to check:

  1. Your permissions settings in the Gigya console for the API Key being used. You need to ensure that you have the "Enable Desktop/Mobile use" permission set as enabled for the API key you are using.

  2. The Facebook Provider configuration settings in the Gigya Console for the API Key being used. Gigya will select Facebook API v1 by default in the provider configurations; if your Facebook Social Network app is new, then it will be using v2 of the API. You need to ensure that you have the correct setting selected.

  3. If you are using a CNAME, then you need to ensure that the CNAME The CNAME configuration is set up correctly on the API key, and that your Facebook Developer Console settings are configured to use the CNAME.

If you make any changes, be sure to save the settings before you change screens.

查看更多
小情绪 Triste *
4楼-- · 2019-08-09 06:25

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.

查看更多
登录 后发表回答