androidiosgoogle-signingoogle-account

When implementing Google Sign-In on Android, iOS, is it possible to indicate in the google account sign-in popup that only email address will be used?


Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Implement google sign in using GoogleSignIn-iOS library for iOS, using CredentialManager for Android

  2. Build the app and press the google sign up button to proceed with the signup process.

  3. In the google account integration popup, you will see that “name, email address, profile picture” are accessible in the user's account.

Expected behavior

I only need the user's email address. I want the popup to show the user that it only uses the email address. As I understand it, name, email address, profile picture are the default public information in google account. However, I will only use the user's email address in my app via google sign-up, and I want the popup to show only the email address. Is this possible?

In.sharedInstance
  .signIn(withPresenting: rootViewController, hint: nil, additionalScopes: additionalScopes) { 
      ...
   }

ScreenShot

Android Code

          val credentialManager = CredentialManager.create(context)
          val request = GetCredentialRequest(
              listOf(
                  GetSignInWithGoogleOption.Builder($google_client_id)
                      .build()
              )
          )
          val result = credentialManager.getCredential(context, request)

iOS Code

let additionalScopes = \["https://www.googleapis.com/auth/userinfo.email"\]
GIDSignIn.sharedInstance.configuration = config
GIDSign

I've tried defining the permission scope with the above code and tested it, but I'm still seeing permissions like google account's name, photo, etc.


Solution

  • No. At this point, those scopes (email, name and profile picture) are considered as a bundle, hence you either ask (and get) all of them or none.