从developers.google.com更新最新的Google Drive SDK for iOS后,在我的应用中将文件从我的设备更新到我的云端硬盘时遇到此问题。我总是得到错误异常,并将消息作为标题。
我认为这是由后端Google REST API的变化造成的,但我不知道如何处理这个问题。以下代码与Google中名为iOS-QuickEditor和Sample tutorial .........
的示例代码几乎相同NSData *fileContent =
[NSData dataWithContentsOfFile:localFilePath];
GTLUploadParameters *uploadParameters =
[GTLUploadParameters uploadParametersWithData:fileContent MIMEType:@"text/plain"];
GTLQueryDrive *query =
[GTLQueryDrive queryForFilesUpdateWithObject:self.driveFile fileId:self.driveFile.identifier uploadParameters:uploadParameters];
[self.driveService executeQuery:query completionHandler:^(GTLServiceTicket *ticket,
GTLDriveFile *updatedFile,
NSError *error) {
// Do something after updating....
}];