When capturing materialized information from materializedItemsDidChange in NSFileProviderReplicatedExtension, the isDownloaded property of NSFileProviderItem is not set during the call to enumerate items (NSFileProviderEnumerationObserver:enumerateItems(for:startingAt:)).
Both the IsDownloaded and isMostRecentVersionDownloaded properties are returning false, even though the item is fully materialized
How to capture this information from file provider extension ?
Any help would be greatly appreciated. Thanks!
Yeah, I see the same thing – If I use the enumerator returned by fileProviderManager.enumeratorForMaterializedItems() to enumerate the materialized items, the item.isDownloaded is false.
That is probably just because the enumerator doesn't maintain the isDownloaded state, and isn't really a problem, because the enumeration does return the materialized items.
If you are interested in the pending items, observe the .fileProviderPendingSetDidChange notification, and then in the notification handler, use the same way to retrieve the enumerator (by calling fileProviderManager.enumeratorForMaterializedItems()) and do the enumeration. The items you get would be the pending items.
Our Synchronizing files using file provider extensions demonstrates how to retrieve the materialized and pending items in great details. You might want to take a look, if haven't yet. The details are in EnumerationView (./common/EnumerationView.swift).
Best,
——
Ziqiao Chen
Worldwide Developer Relations.