google登录成功后不会调用委托方法 [英] google signin not calling delegate method after success

查看:109
本文介绍了google登录成功后不会调用委托方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用谷歌sdk进行谷歌登录但在输入电子邮件和密码后

i am using google sdk for google signin but after entering the email and password

在viewDidLoad中我添加了委托

in viewDidLoad i have added delegate

//设置Google登录代表

//set Google sign In delegates

    [GIDSignIn sharedInstance].delegate = self;
    [GIDSignIn sharedInstance].uiDelegate = self;

-(void)signIn:(GIDSignIn *)signIn didSignInForUser:(GIDGoogleUser *)user withError:(NSError *)error{
}

未调用。当我输入用户电子邮件和密码时,问题在哪里

not called . where is the issue not getting

调用此方法并显示错误为空。

this method is called and showing error is null.

- (void)signInWillDispatch:(GIDSignIn *)signIn error:(NSError *)error {

}


推荐答案

在AppDelegate.m文件中添加以下代码

Add following code in your AppDelegate.m file

-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{



    return [[GIDSignIn sharedInstance] handleURL:url
                               sourceApplication:sourceApplication
                                      annotation:annotation];
    }

这篇关于google登录成功后不会调用委托方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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