iOS:Google 登录错误,您的应用程序被阻止

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 同意屏幕

现在确认您已选择了面临问题的正确项目

在此处检查您的用户上限。如果达到了更高的限制,那么您必须通过谷歌验证您的产品。

看这里:

在此输入图像描述

现在解决这个问题:

  1. 现在转到“编辑应用程序”
  2. 转到“应用程序域”部分
  3. 在“应用程序主页”、“应用程序隐私政策链接”和“应用程序服务条款链接”中提供信息。
  4. 现在添加“授权域”-“添加授权域后,您可以使用其任何子域或页面。如果您在创建凭据时添加了授权 Javascript 来源和授权重定向 URI,它们也会出现在此处。”
  5. 请按照此处的验证步骤操作:https ://kinsta.com/blog/google-site-verification/

验证完成后,此问题将得到解决。

或者,您也可以在 Google Console 中创建具有相同 BundleID 的新项目并创建新凭据。通过使用此凭证,您将获得 100 个用户的新用户上限。

注意:替代解决方案只是暂时的。永久解决方案是通过 Google 验证应用程序。