iOS : Google Sigin error, 您的应用程序被阻止

标签 ios objective-c google-signin

从谷歌登录时,出现此错误
“此应用试图访问您 Google 帐户中的敏感信息。为了确保您的帐户安全,Google 阻止了此访问 enter image description here
下面提到了我的代码,我在那里调用了 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 同意屏幕
现在确认您选择了一个正确的项目面临的问题
在此处查看您的用户上限。如果这达到了更高的限制,那么您必须使用谷歌验证您的产品。
看这里:
enter image description here
现在要解决这个问题:

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

  • 验证完成后,此问题将得到解决。
    或者,您也可以在 Google Console 中创建一个具有相同 BundleID 的新项目并创建新凭据。通过使用此凭据,您将获得 100 个用户的新用户上限。
    注意:替代解决方案只是暂时的。永久的解决方案是通过谷歌验证应用程序。

    关于iOS : Google Sigin error, 您的应用程序被阻止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65517464/

    相关文章:

    iphone - 使用飞行模式是否是一种可以接受的测试连接缺失的方法?

    iphone - 服务器无法识别 iPhone 中 HTTP header SOAPAction 的值?

    ios - 当 Apple 应用程序关联文件下载到 iOS 设备时

    ios - Today Extension View 在重绘时闪烁

    ios - 从FlashDevelop发布到iOS的问题:compile-abc不兼容

    ios - 释放占用大量内存的弹出窗口

    objective-c - iOS 委托(delegate)命名约定 - 应该、将要、已完成

    iOS - 使用 auth0 删除同意对话框第 3 方身份验证

    android - GoogleSignInOptions 中的 requestIdToken 获取空指针异常

    javascript - Google 登录按钮未在 React 中呈现