请帮忙,这是我的代码:
NSData * fileContent = [@"ahcnuefewfewfsnjcdsjc" dataUsingEncoding:NSUTF8StringEncoding];
GTLRUploadParameters * uploadParameters = [GTLRUploadParameters uploadParametersWithData:fileContent MIMEType:@"text/plain"];
GTLRDrive_File * driveFile = [GTLRDrive_File new];
driveFile.name = @"First blood.txt";
GTLRDriveQuery_FilesCreate * query = [GTLRDriveQuery_FilesCreate queryWithObject:driveFile uploadParameters:uploadParameters];
query.fields = @"279683368406-cegfq720t7oe4j912m88pvl5qqbkv022.apps.googleusercontent.com";
self.driveService = [ GTLRDriveService new];
self.driveService.authorizer = self.authorization;
[self.driveService executeQuery:query completionHandler:^(GTLRServiceTicket * _Nonnull callbackTicket, id _Nullable object, NSError * _Nullable callbackError) {
if (!callbackError) {
NSLog(@"---upLoad File Success---");
}
else{
NSLog(@"---upLoad File fail---");
}
}];