0

After updating latest Google Drive SDK for iOS from developers.google.com, I encountered this issue when updating a file from my device to my Drive in my app. I always got error exception with the message as title.

I think it causes by changes of Google REST API in the backend, but I do not figure out how to deal with this. This code below is almost same as sample code from Google named iOS-QuickEditor and 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....
}];
Exile3daime
  • 611
  • 6
  • 18
  • I found a thread that might be helpful. This is not an iOS thread but it is about migration to Google Drive v3. Fornunately, the error you are obtanining was discussed there. See [SO-35143283](http://stackoverflow.com/questions/35143283/google-drive-api-v3-migration). – gerardnimo Feb 04 '16 at 12:34
  • Thank you, I got this thread as well. It's, however, a little hard for me to translate it to Objective-C. Does that mean I need to access Drive via RESTful API instead of SDK methods? – Exile3daime Feb 04 '16 at 13:26

0 Answers0