我正在使用 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/