Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

objective c - iOS : Google Sigin error, Your app is blocked

on time of sign-in from google, this error appears

"This app tried to access sensitive info in your Google account. To keep your account safe, google blocked this accessenter image description here"

my code is mention below where i called 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];
    }   
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Please go to https://console.developers.google.com and login with your creds.

Now go to APIs & Services -> OAuth consent screen

Now confirm you have selected a correct project the issue is facing for

Check here your user cap limit. If this reached to the higher limit then you have to verify you product with google.

See here:

enter image description here

Now to resolve this:

  1. Now go to "Edit App"
  2. Go to "App domain" section
  3. Provide information in "Application home page", "Application privacy policy link" and "Application Terms of Service link".
  4. Now add "Authorised Domain" - "After you add an authorised domain, you can use any of its subdomains or pages. If you added Authorised Javascripts Origins and Authorised Redirect URIs when you created your credentials, they will also appear here."
  5. Follow verification steps form here: https://kinsta.com/blog/google-site-verification/

Once Verification done this issue will get resolved.

Alternatively, You can also create a new Project with same BundleID in the Google Console and create new credentials. By using this credential you will get fresh user cap of 100 users.

Note: Alternative solution is only temporary. Permanent solution is to verify the app with Google.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...