I have this code that has worked in the past, but now seems to not work. It is a stripped-down example of the actual Google code from github. Essentially, I set theUsername and thePassword to a google account containing spreadsheets at the top level in Google Drive, then call 'fetch', expecting there to be no error returned (and there was no error in the past...). Instead, I get an NSError with description of 'Domain=com.google.GDataServiceDomain' and code of '404'.
I've checked the account, and there are spreadsheets there, exactly as there were before. I'm lost - has the spreadsheets API changed? Is there an easy fix for this? I have dozens of projects crafted around the objective C spreadsheet APIs and the APIs for Objective C aren't exactly updated regularly. Help!
- (void)findSpreadsheet
{
if (mSpreadsheetFetchError == nil)
{
// Look for named spreadsheet
}
else
{
NSLog(@"Error fetching spreadsheet '%@': %@", self.spreadsheetName, [mSpreadsheetFetchError description]);
self.fetchInProgress = NO;
}
}
- (GDataServiceGoogleSpreadsheet *)spreadsheetService
{
static GDataServiceGoogleSpreadsheet* service = nil;
if (!service)
{
service = [[GDataServiceGoogleSpreadsheet alloc] init];
[service setShouldCacheResponseData:YES];
[service setServiceShouldFollowNextLinks:YES];
}
[service setUserCredentialsWithUsername:self.theUsername
password:self.thePassword];
return service;
}
- (void)fetch
{
[self setSpreadsheetFeed:nil];
[self setSpreadsheetFetchError:nil];
[self setWorksheetFeed:nil];
[self setWorksheetFetchError:nil];
[self setEntryFeed:nil];
[self setEntryFetchError:nil];
mIsSpreadsheetFetchPending = YES;
NSLog(@"Submitting fetch request...");
GDataServiceGoogleSpreadsheet *service = [self spreadsheetService];
NSURL *feedURL = [NSURL URLWithString:kGDataGoogleSpreadsheetsPrivateFullFeed];
[service fetchFeedWithURL:feedURL
delegate:self
didFinishSelector:@selector(feedTicket:finishedWithFeed:error:)];
}
// spreadsheet list fetch callback
- (void)feedTicket:(GDataServiceTicket *)ticket
finishedWithFeed:(GDataFeedSpreadsheet *)feed
error:(NSError *)error
{
[self setSpreadsheetFeed:feed];
[self setSpreadsheetFetchError:error];
mIsSpreadsheetFetchPending = NO;
[self findSpreadsheet];
}