Integration with Google Drive on iOS giving error when calling insert

I am working in an application and trying to add the Google API to use the Google drive, where the user can store / share application files. I found a good tutorial for this Google Drive Tutorial I uploaded a sample code that worked on it, I uploaded the code yesterday, it worked fine, the files are stored as expected, today I check agin, every time I get a meesage error. find the console message

An error occurred: Domain Error = com.google.GTLJSONRPCErrorDomain Code = 400 "Operation could not be completed. (Unsupported content with type: application / json-rpc; charset = utf-8)" UserInfo = 0x75b11f0 {error = Unsupported content with type : application / json-rpc; charset = utf-8, GTLStructuredError = GTLErrorObject 0x75a3f90: {message: "Unsupported content with type: application / json-rpc; charset = utf-8": 400 data: [1]}, NSLocalizedFailureReason = (Unsupported content with type: Application / JSON -RPC; encoding = UTF-8)}

can anyone suggest me an alternative to integrating google drive in iOS app.

if this happens with a sample code, what could be the Google API for iOS for integration into our applications.

Note. I created kClientSecret and kClientId also to use the DrEdit sample code provided by Google.

+3
source share
1 answer

Recent changes to the Google Drive service require you to specify a mime type other than "application / json-rpc" when downloading a file. This mime type is used by default when using the ObjectiveC SDK, so you need to specify it.

To make the sample that comes with the SDK, open DriveWindowController.m and in the method "uploadFileAtPath:" in the section "newFile.title = file_name"; add "newFile.mimeType = @" image / png ";". Change "image / png" to the MIME type of the uploaded file.

GTLDriveFile *newFile = [GTLDriveFile object];
newFile.title = filename;
newFile.mimeType = @"image/png";

: , Google .

+2

All Articles