Skip to content

Instantly share code, notes, and snippets.

@chirags
Created September 13, 2012 23:01
Show Gist options
  • Save chirags/3718407 to your computer and use it in GitHub Desktop.
Save chirags/3718407 to your computer and use it in GitHub Desktop.
// 0. Include the sign in with Google+ button. https://developers.google.com/+/mobile/ios/#sign_in_with_google
...
// 1. Create a |GTLServicePlus| instance to send a request to Google+.
GTLServicePlus* plusService = [[[GTLServicePlus alloc] init] autorelease];
plusService.retryEnabled = YES;
// 2. Set a valid |GTMOAuth2Authentication| object as the authorizer.
[plusService setAuthorizer:appDelegate.auth];
// 3. Create a |GTLQuery| object to fetch person data.
GTLQueryPlus *query = [GTLQueryPlus queryForPeopleGetWithUserId:@"me"];
// 4. Use the "v1" version of the Google+ API.
plusService.apiVersion = @"v1";
[plusService executeQuery:query
completionHandler:^(GTLServiceTicket *ticket,
id object,
NSError *error) {
if (error) {
GTMLoggerError(@"Error: %@", error);
} else {
GTMLoggerInfo(@"Fetched your profile data: %@", object);
}
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment