Gdata Api returns Code=404, please help

91 views
Skip to first unread message

Burhan Khawaja

unread,
Jan 6, 2016, 11:37:33 AM1/6/16
to Google Data APIs Objective-C Client Library Discussion
Hello,

I'm trying to use gData Api in order to manipulate google services data. I'm using sample code given on github page of gData to test and run the api but so far what I'm getting is an error: 
Error Domain=com.google.GDataServiceDomain Code=404 "(null)"


Here is the code that I'm using:

- (IBAction)loginButton:(id)sender {

    usernameStr = username.text;

    passwordStr = password.text;

    service = [[GDataServiceGoogleCalendar alloc] init];

    

    [service setUserCredentialsWithUsername:usernameStr

                                   password:passwordStr];

    NSURL *feedURL = [GDataServiceGoogleCalendar calendarFeedURLForUsername:usernameStr];

    

    GDataServiceTicket *ticket;

    ticket = [service fetchFeedWithURL:feedURL

                              delegate:self

                     didFinishSelector:@selector(ticket:finishedWithFeed:error:)];

    

}


- (void)ticket:(GDataServiceTicket *)ticket

finishedWithFeed:(GDataFeedCalendar *)feed

         error:(NSError *)error {

    

    if (error == nil) {

        NSArray *entries = [feed entries];

        if ([entries count] > 0) {

            

            GDataEntryCalendar *firstCalendar = [entries objectAtIndex:0];

            GDataTextConstruct *titleTextConstruct = [firstCalendar title];

            NSString *title = [titleTextConstruct stringValue];

            

            NSLog(@"first calendar's title: %@", title);

        } else {

            NSLog(@"the user has no calendars");

        }

    } else {

        NSLog(@"fetch error: %@", error);

    }

}

Burhan Khawaja

unread,
Jan 8, 2016, 9:52:48 AM1/8/16
to Google Data APIs Objective-C Client Library Discussion
Sorted out the problem, its not possible now to get credential like this. Have to use oAuth2.
Reply all
Reply to author
Forward
0 new messages