小编Nae*_*ain的帖子

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

从谷歌登录时出现此错误

“此应用试图访问您的 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)

objective-c ios google-signin

5
推荐指数
1
解决办法
3387
查看次数

标签 统计

google-signin ×1

ios ×1

objective-c ×1