Search code examples
iphoneiosgdatagdata-apigoogle-tasks-api

Can't find Google tasks API


I am working on the app in which I fetch the contacts, Photo albums, use google map, calendar using GData. they all working perfectly but I am not able to fetch the tasks of the google. so can anyone help me for the Google tasks API.? Thank you in advance


Solution

  • There is a generated interface for the Google Tasks API included in the objective c gdata library. Take a look at the TasksSample project included in the Examples directory of the repository. Make sure you have a relatively recent copy of the client library.

    http://code.google.com/p/google-api-objectivec-client/source/browse/#svn%2Ftrunk%2FExamples%2FTasksSample

    For example, here's how to query for a list:

    GTLQueryTasks *query = [GTLQueryTasks queryForTasksListWithTasklist:someTasklistID];
    query.showCompleted = someBool;
    query.showHidden = anotherBool;
    query.showDeleted = aThirdBool;
    
    aTasksTicket =  [service executeQuery:query
                           completionHandler:^(GTLServiceTicket *ticket,
                                               id tasks, NSError *error) {
                             // callback
                             [self doSomethingWithTasks: tasks];
                           }];