使用 GIDSignIn 处理使用另一个 Google 应用程序登录时不获取 Google 用户

2023-11-27

我在用着iOS 版 Google 登录当使用模拟器时,它工作正常,因为没有安装谷歌应用程序并且用户正在获取,但是当使用我的iPhone 6设备时,打开youtube(其中有一些注册帐户)来处理登录。 之后,当返回应用程序代码时,不要输入此功能:

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

任何人都可以帮助我,我无法使用其他功能进行登录,我必须致电[[GIDSignIn sharedIstance] signIn]此功能检测是否安装了另一个谷歌应用程序并自动打开另一个谷歌应用程序或Webview。


我通过正确设置 GIDSignIn 实例的一些属性解决了该问题。例如:

GIDSignIn*sigNIn=[GIDSignIn sharedInstance];
[sigNIn setDelegate:self];
[sigNIn setUiDelegate:self];
sigNIn.shouldFetchBasicProfile = YES;
sigNIn.allowsSignInWithBrowser = NO;
sigNIn.allowsSignInWithWebView = YES;
sigNIn.scopes = @[@"https://www.googleapis.com/auth/plus.login",@"https://www.googleapis.com/auth/userinfo.email",@"https://www.googleapis.com/auth/userinfo.profile"];
sigNIn.clientID =@"xxxxxxxxxxxxxxxxxxxxxxxgai.apps.googleusercontent.com";
[sigNIn signIn];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 GIDSignIn 处理使用另一个 Google 应用程序登录时不获取 Google 用户 的相关文章

随机推荐