从谷歌登录时,出现此错误
“此应用试图访问您 Google 帐户中的敏感信息。为了确保您的帐户安全,Google 阻止了此访问 ”
下面提到了我的代码,我在那里调用了 google SignIn
#pragma mark - Google Drive Login
-(void)googlePlusLogin{
GIDSignIn *signin = [GIDSignIn sharedInstance];
signin.shouldFetchBasicProfile = true;
signin.delegate = self;
signin.presentingViewController = self.window.rootViewController;
//signin.uiDelegate = self;
NSString *driveWrite = @"https://www.googleapis.com/auth/drive";
NSArray *currentScopes = [GIDSignIn sharedInstance].scopes;
// [GIDSignIn sharedInstance].scopes = [currentScopes arrayByAddingObject:driveScope];
[GIDSignIn sharedInstance].scopes = [currentScopes arrayByAddingObject:driveWrite];
[self performSelector:@selector(checkForLoginInGoogle) withObject:nil afterDelay:0.1];
}
-(void)checkForLoginInGoogle{
GIDSignIn *signin = [GIDSignIn sharedInstance];
if ([signin hasPreviousSignIn]) {
[signin restorePreviousSignIn];
}
else{
[signin signIn];
}
}
最佳答案
请转至https://console.developers.google.com并使用您的凭据登录。
现在转到 API 和服务 -> OAuth 同意屏幕
现在确认您选择了一个正确的项目面临的问题
在此处查看您的用户上限。如果这达到了更高的限制,那么您必须使用谷歌验证您的产品。
看这里:
现在要解决这个问题:
验证完成后,此问题将得到解决。
或者,您也可以在 Google Console 中创建一个具有相同 BundleID 的新项目并创建新凭据。通过使用此凭据,您将获得 100 个用户的新用户上限。
注意:替代解决方案只是暂时的。永久的解决方案是通过谷歌验证应用程序。
关于iOS : Google Sigin error, 您的应用程序被阻止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65517464/