Gigya Facebook登录:未调用完成处理程序 [英] Gigya facebook login: completion handler not called

查看:79
本文介绍了Gigya Facebook登录:未调用完成处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Gigya-SDK通过Facebook登录该应用程序.在Facebook上的设置看起来不错,没有Gigya的本机Facebbook登录效果很好.但是,当我调用Gigya方法时,永远不会调用在Facebook网站成功登录后的完成处理程序.

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
  • 推荐答案

    经过几次尝试,我得到了对我有帮助的解决方案.

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

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

    我必须放置正确的APIDomain. Gigya的文档仅提及

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

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

    默认情况下使用美国域.

    which was using US domain by default.

    这篇关于Gigya Facebook登录:未调用完成处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆