0

My app works with pictures and annotations files. The annotation files are just XML files containing information for each picture. That way, a user can have for example a dataset of 100 pictures + 100 annotation files.

At some point I want the user to be able to export those files to a cloud service, ideally iCloud or Google-Drive, so that they are available for further processing/work.

The Files App looked the best candidate for this task. The user has already connected their cloud providers in the Files App, and I don't need to worry about almost anything.

 func presentLocationPicker(forExportingFiles urls: [URL]) {
        let documentPicker = UIDocumentPickerViewController(urls: urls, in: .exportToService)
        self.present(documentPicker, animated: true)
 }

I thought it would be easy, but the reality is quite different. The integration of Google Drive with the Files App seems very weak. I have the following problems with Google Drive:

Blocker 1 - When selecting the google drive folder I want to export the files, I get the following system alert: The Operation Can't Be Completed. Couldn't communicate with the helper application enter image description here

Blocker 2 - When presenting the UIDocumentPickerViewController the list of cloud providers is sometimes greyed out.

enter image description here

Blocker 3 - If directly from the Files App I try to move a folder (with 100 items for example) to Google Drive, it does not work either. Only some files are copied, and not with the original folder structure. Just a mess.

So my first question is: Am I supposed to do something different with UIDocumentPickerViewController to avoid Blocker 1?

Second question is: Is there any other way of exporting multiple files (more than 100) to the user's Google Drive account? I am out of ideas.

crom87
  • 1,141
  • 9
  • 18

1 Answers1

0

This is from the Google Drive API page, but I suspect the SDK is beholden to the same limitations.

https://developers.google.com/drive/api/v3/manage-uploads

  • Simple upload: uploadType=media. For quick transfer of a small file (5 MB or less). To perform a simple upload, refer to Performing a Simple Upload.
  • Multipart upload: uploadType=multipart. For quick transfer of a small file (5 MB or less) and metadata describing the file, all in a single request. To perform a multipart upload, refer to Performing a Multipart Upload.

Emphasis mine.

You will likely want to break up your requests to fit within that restriction.

CodeBender
  • 35,668
  • 12
  • 125
  • 132