New Google APIs Client Library for Objective-C
- John Wang
A while back, I wrote a small tutorial on how to use Google's GData Client library for iPhone. It's a pretty popular tutorial that constantly gets questions. Today, Google announced a new version of the Google Data library for Objective-C. I'm pretty exicted about this for a couple of reasons. The new Client library utilizes JSON, which I'm a big fan of and it also the new OAuth2 for authentication.
It looks just amazing.
#import "GTLBooks.h"
GTLServiceBooks *service = [[GTLServiceBooks alloc] init];
GTLQueryBooks *query = 
  [GTLQueryBooks queryForVolumesListWithQ:@"Mark Twain"];
query.filter = kGTLBooksFilterFreeEbooks;
[service executeQuery:query
    completionHandler:^(GTLServiceTicket *ticket,
                        id object, NSError *error) {
      // callback
      if (error == nil) {
        GTLBooksVolumes *results = object;
        for (GTLBooksVolume *volume in results) {
          NSLog(@"%@", volume.volumeInfo.title);
        }
      }
    }];
And it also follows the Google Objective-C Style Guide which I'm also a fan of.
Check out the new version of the Client library at the Google Project page.
I'm going to try and get a new updated tutorial in a couple of days.