FileProvider extension approach

Hi all,

I'm working on a FileProvider extension and I'm getting kind of lost. My questions:

  • The working set of the app is local, offline and shouldn't contact the cloud. Do I build a working set on-device, or should I -after login- collect all working set data and cache it on device and signal a change to the working set?
  • My assumption is that I don't save folder nodes to disk when enumerated from the cloud, but only the actual files, is that correct?

Thanks in advance and have a wonderful day!

Anyone from Apple able to help me?

The working set is your mechanism to notify FileProvider of remote changes to your files. It should include, at a minimum, all of the items in the materializedSet, plus the direct children of any directories in the materialized set (since those will have dataless placeholders on disk). The implementation is up to you.

I’m not sure I understand your second question. As a general principle, you should not be touching the files in the user visible storage location (in ~/Library/CloudStorage/yourApp-yourDomain).

  • The system enumerates directories from your extension, and places them on disk in the user visible storage on your behalf.
  • The system calls fetchContents to populate dataless files on demand. You should write the download file into a temporary directory, and give the system the URL on the completion handler. The system handles transferring the contents to the user visible storage.

I recommend reading the header files in the FileProvider framework, there are detailed header comments.

FileProvider extension approach
 
 
Q