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

标签 ios iphone ios8 appdelegate google-signin

我正在使用 Google Sign-In for iOS当使用模拟器时它工作正常,因为没有安装谷歌应用程序并且用户正在获取,但是当使用我的 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];

关于ios - 使用 GIDSignIn 处理登录另一个 Google 应用程序时不获取 Google 用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30864202/

相关文章:

ios - 如何将 html 文件加载到多个目标的 webView 中

iphone - 将上下文传递给另一个方法

objective-c - applyBlurWithRadius 适用于 iPhone 6,而不是 6+ (UIImage+ImageEffects)

ios - 在 UITableView 中隐藏单元格(在 Xamarin 中)

ios - 沿着贝塞尔路径拖动 UIView

iphone - SCNetworkReachabilityRef在Xcode上泄漏

iphone - IOS 6.0 和 IOS 5.0 中方法调用顺序发生变化

ios - NSLengthFormatter 未显示正确的值

ios - 无法在 swift iOS 8 扩展中转换 UIImage

ios - 为不同的 iPhone 调整以图像为背景的 UIButton 的大小