I'm struggling to find a way to monitor the progress (in percent, or bytes) of a download from iCloud Drive. I.e. files outside of the app's ubiquitous document folder. Our app provides a directory browser (which is accessed using a security scoped bookmark granted by the user). In this browser we want to enable users to download files from iCloud analogous to the user experience provided in Files.app.
It seems that NSMetaDataQuery
would be the right way to go nowadays. However i don't get any results for queries outside of my own app container. I suppose that's a permission problem?
Luckily we can get most of what we need using url's resource values. Also initiating and canceling a download works using NSFileManager
. However i found now suitable way of determining a download's progress. NSURLUbiquitousItemPercentDownloadedKey
is deprecated and doesn't give any results.
Did i overlook something? Is there a way to get NSMetaDataQuery
working with security scoped bookmarks to folders?