Search code examples
iosobjective-cgoogle-fusion-tables

Google Fusion Tables from iOS app / Objective-C?


I started developing ios application that integrate with google fusion tables. I searched both google gdata and google client libraries but they do not offer fusion tables. On google groups they say "gtm-http-fetcher and gtm-oauth2 libraries could be helpful" but did not find more. Can you please advice me or point me to a example? thanks!


Solution

  • It's like they say :), there's no official Google Obj-C API for Fusion Tables so in your app you should use an authenticated GTMHTTPFetcher instance to communicate with the Fusion Tables API v1.0 via HTTP requests. Depending on what your app needs to do, you might also have to use other Google APIs such as the Drive SDK for setting your Fusion Tables permissions.

    A quick conceptual overview of how to use the gtm-http-fetcher and gtm-oauth2 libraries in your app:

    1. set your desired access scope: [GTMOAuth2Authentication scopeWithStrings:...
    2. use GTMOAuth2ViewControllerTouch controller for authentication: [GTMOAuth2ViewControllerTouch controllerWithScope:...
    3. retrieve the GTMOAuth2Authentication instance, for subsequent usage it can also be saved to / retrieved from iOS keychain
    4. use the GTMOAuth2Authentication auth to authenticate an GTMHTTPFetcher instance
    5. now you can use the GTMHTTPFetcher to submit HTTP requests to Fusion Tables API v1.0 as described here