Skip to content

Commit

Permalink
[Post] Google APIs Client Library for Objective-C
Browse files Browse the repository at this point in the history
  • Loading branch information
jwang committed Sep 1, 2011
1 parent e0e96a7 commit 5f64692
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions _posts/2011-08-31-Google-APIs-for-Objective-C.markdown
@@ -0,0 +1,38 @@
---
layout: post
title: New Google APIs Client Library for Objective-C
tags: [ios objective-c gdata]
categories: blog
---

A while back, I wrote a [small tutorial on how to use Google's GData Client library for iPhone](http://johntwang.com/blog/2009/06/08/how-to-use-google-apis-with-iphone-sdk/). It's a pretty popular tutorial that constantly gets questions. Today, [Google announced a new version of the Google Data library for Objective-C](http://googlecode.blogspot.com/2011/08/new-objective-c-library-for-new.html). I'm pretty exicted about this for a couple of reasons. The [new Client library](http://code.google.com/p/google-api-objectivec-client/) utilizes JSON, which I'm a big fan of and it also the new [OAuth2 for authentication](http://googlecode.blogspot.com/2011/03/making-auth-easier-oauth-20-for-google.html).

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](http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml) which I'm also a fan of.

Check out the new version of the [Client library](http://code.google.com/p/google-api-objectivec-client/) at the Google Project page.

I'm going to try and get a new updated tutorial in a couple of days.

0 comments on commit 5f64692

Please sign in to comment.