Not getting the email using Google Authentication in Firebase
<p>I am using the code provided by Firebase for Google Authentication and somehow, the authentication was successful but the email was not correctly imported to Firebase.</p>

<p><a href="https://firebase.google.com/docs/auth/ios/google-signin" rel="noreferrer">https://firebase.google.com/docs/auth/ios/google-signin</a></p>

<p>As you can see in the screenshot below, the email is blank.  When I looked at the debugger, it is showing nil.<br>
I clicked allow viewing email during authentication but I think there are still some settings that was not done correctly.  Could someone help me to take a look?  I am interested to use the email to create the username for each user.</p>

<p><a href="https://i.stack.imgur.com/2d3Y2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2d3Y2.png" alt="enter image description here"></a></p>

<pre><code>func signIn(signIn: GIDSignIn!, didSignInForUser user: GIDGoogleUser!, withError error: NSError!) {
    if let error = error {
        print(error.localizedDescription)
        return
    }

    let authentication = user.authentication
    let credential = FIRGoogleAuthProvider.credentialWithIDToken(authentication.idToken,
                                                                 accessToken: authentication.accessToken)
    FIRAuth.auth()?.signInWithCredential(credential) { (user, error) in
        if error != nil {
            print(error?.localizedDescription)
            return
        }

        print("User logged in with Google...")
        self.performSegueWithIdentifier("ToHome", sender: nil)
    }
}
</code></pre>