In my iPhone app I am using google sign in using Oauth2
, I am following this insturction and successfully login in
- (void)viewController:(GTMOAuth
By default, the GTMOAuth2ViewControllerTouch viewController will fetch the user's email, but not the rest of the user's profile.
The full profile can be requested from Google's server by setting this property before sign-in:
GTMOAuth2ViewControllerTouch *viewController;
viewController.signIn.shouldFetchGoogleUserProfile = YES;
The profile will be available after sign-in as
NSDictionary *profile = viewController.signIn.userProfile;
and to get other information you have to change the scope
string and begin fetch again.
here are some scope urls
@"https://www.googleapis.com/auth/plus.me"
@"https://www.googleapis.com/auth/userinfo.email"
@"https://www.googleapis.com/auth/tasks"