I’m trying to use Google Drive in my iOS app. It authenticates and browses ok, but when I try to upload a file, I get the following error:
*** Assertion failure in -[GTLService uploadFetcherWithRequest:fetcherService:params:](), /google-api-objectivec-client-read-only/Source/Objects/GTLService.m:565
Here’s my relevant code:
GTLUploadParameters *uploadParameters = [GTLUploadParameters uploadParametersWithData:fileContent MIMEType:@"application/pdf"];
GTLDriveFile *file = [[GTLDriveFile alloc] init];
file.title = @"test.pdf";
GTLQueryDrive *query = [GTLQueryDrive queryForFilesInsertWithObject:file uploadParameters:uploadParameters];
[self.driveService executeQuery:query completionHandler:^(GTLServiceTicket *ticket,
GTLDriveFile *updatedFile,
NSError *error) {
NSLog(@"Done");
}];
Has anyone run into this problem? Obviously I’m missing something somewhere in the setup I guess but I have no idea what.
I browsed through the source and the corresponding line is:
A search for that on stackoverflow led to this answer: