gpt4 book ai didi

ios - 谷歌登录成功后不调用委托(delegate)方法

转载 作者:可可西里 更新时间:2023-11-01 04:43:23 27 4
gpt4 key购买 nike

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

在 viewDidLoad 中我添加了委托(delegate)

//设置谷歌登录代理

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

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

不叫。问题在哪里没有得到

当我输入用户电子邮件和密码时,我得到了这个

enter image description here

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

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

}

最佳答案

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

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



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

关于ios - 谷歌登录成功后不调用委托(delegate)方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37383280/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com