I have encountered the exact same issue!
After hours and hours of looking into the GTMOAuth2 codes and logging everything and tracing the methods that were called along the way, I managed to get it to work!
What I did eventually to retrieve the email address was to hack into the GoogleOAuth class GTMOAuth2SignIn.m under method:
- (void)auth:(GTMOAuth2Authentication *)auth finishedWithFetcher:(GTMHTTPFetcher *)fetcher error:(NSError *)error
This is because the authentication will show an error, which will result in the authenthication object not retrieving the values of the authenticated user. ie. not pulling the email address of the user.
Therefore I added a line to the method and now it shows as this:
- (void)auth:(GTMOAuth2Authentication *)auth finishedWithFetcher:(GTMHTTPFetcher*)fetcher error:(NSError *)error
{
self.pendingFetcher = nil;
#if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT
if (error == nil && (self.shouldFetchGoogleUserEmail || self.shouldFetchGoogleUserProfile) && [self.authentication.serviceProvider isEqual:kGTMOAuth2ServiceProviderGoogle]) {
// fetch the user's information from the Google server
[self fetchGoogleUserInfo];
} else {
// we're not authorizing with Google, so we're done
/**** CHANGED HERE TO CALL THE FETCH METHOD NO MATTER WHAT SO THAT THE EMAIL CAN BE SHOWN *****/
[self fetchGoogleUserInfo];
/**********************************************************************************************/
//[self finishSignInWithError:error]; // comment this out so that it will it will initiate a successful login
}
#else
[self finishSignInWithError:error];
#endif
}
After that, I used the same call
[_auth userEmail]
and was able to get the email address of the authenticated user.
It was a long, painful and hair pulling debugging session for me, so I hope this saved you some time and plenty of hair as well! :)