Nae*_*ain 5 objective-c ios google-signin
从谷歌登录时出现此错误
“此应用试图访问您的 Google 帐户中的敏感信息。为了确保您的帐户安全,Google 阻止了此访问
”
我的代码在下面提到,我打电话给谷歌登录
#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];
}
}
Run Code Online (Sandbox Code Playgroud)
小智 2
请访问https://console.developers.google.com并使用您的凭据登录。
现在转到 API 和服务 -> OAuth 同意屏幕
现在确认您已选择了面临问题的正确项目
在此处检查您的用户上限。如果达到了更高的限制,那么您必须通过谷歌验证您的产品。
看这里:
现在解决这个问题:
验证完成后,此问题将得到解决。
或者,您也可以在 Google Console 中创建具有相同 BundleID 的新项目并创建新凭据。通过使用此凭证,您将获得 100 个用户的新用户上限。
注意:替代解决方案只是暂时的。永久解决方案是通过 Google 验证应用程序。
| 归档时间: |
|
| 查看次数: |
3387 次 |
| 最近记录: |