I'm developing an iOS app.
Through a .fileImporter
I get access to a directory URL which might be provided by an external service like Dropbox (using a FileProvider
).
As the user picked the URL I have full access to it.
I want to get the contents of the directory:
FileManager.default.contentsOfDirectory(
at: url,
includingPropertiesForKeys: keys,
options: [.skipsHiddenFiles]
)
Unfortunately I only get whatever files the system is currently aware of, which in case of external providers is often not much.
If the user opens the Apple Files app and navigates to the folder then the system gets the content from the external provider and back in my app contentsOfDirectory
would show everything.
What can I do to get a list of the URLs?
Can I somehow trigger the system to update from the external provider? Or is there another way of handling this situation?