Gigya facebook login: completion handler not called

只谈情不闲聊 提交于 2019-12-11 04:46:11

问题


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

回答1:


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.




回答2:


What result do you get with this:

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

}];




回答3:


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.



来源:https://stackoverflow.com/questions/26734090/gigya-facebook-login-completion-handler-not-called

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