iOS11 file provider extension not working

716 views Asked by At

I am currently working on an app that stores documents to cloud storage. And I need to place my documents in the new files app. And now I am getting the list of documents and once I click a single document there is no data available for preview. And I'm not sure in file provider extension where to write the filedata to the file and what URL should we return to func urlForItem(withPersistentIdentifier identifier: NSFileProviderItemIdentifier) -> URL?

1

There are 1 answers

0
Kay On

You probably want to store the files somewhere inside your app group container so that both the extension and the app can access the file.

If you want to put the files in some subdirectory is up to you. Following the suggestion from the WWDC session and putting the item identifier in there followed by the file name is probably not a bad idea. This allows you to easily get the item identifier from the url and it also helps you avoid naming collisions.