如何将文件夹上传到Google Driver IOS App中的appDataFolder

如何上传Google云端硬盘的appDataFolder上的文件夹,我正在尝试下面的代码,但不能正常工作。 所以,可以任何朋友请帮助我上传从iOS应用程序的谷歌驱动器中的文件夹。

GTLServiceDrive *drive= [self driveService]; GTLDriveFile *folder = [GTLDriveFile object]; folder.mimeType = @"application/vnd.google-apps.folder"; folder.parents = @[appDataFolder]; GTLUploadParameters *uploadParameters = [GTLUploadParameters uploadParametersWithData:data MIMEType:@"application/vnd.google-apps.folder"]; GTLQueryDrive *query = [GTLQueryDrive queryForFilesCreateWithObject:folder uploadParameters:uploadParameters]; //query.q = [NSString stringWithFormat:@"appDataFolder"]; [drive executeQuery:query completionHandler:^(GTLServiceTicket *ticket, GTLDriveFile *updatedFile, NSError *error) { if (error == nil) { } else { } }]; 

您需要设置driveFile的Parents属性

 GTLDriveParentReference *parentRef = [GTLDriveParentReference object]; parentRef.identifier = folderIdentifier; // identifier property of the folder driveFile.parents = @[ parentRef ];