我正在尝试在我的 iOS 应用中使用 Google Drive。它验证并浏览正常,但是当我尝试上传文件时,出现以下错误:
*** Assertion failure in -[GTLService uploadFetcherWithRequest:fetcherService:params:](), /google-api-objectivec-client-read-only/Source/Objects/GTLService.m:565
这是我的相关代码:
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");
}];
有没有人遇到过这个问题?显然,我猜我在设置的某个地方遗漏了一些东西,但我不知道是什么。