I have an app with file provider extension in it. I tried giving support to the new file app with the ios 11 using this link
I did what is instructed in this but no item is getting displayed. I have added this
NSExtensionFileProviderSupportsEnumeration = YES
ProviderEnumerator
ProviderItem
func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) {
observer.didEnumerate([ProviderItem(name: "raghav", type: "public.folder", identifier: "12334444", parentId: "-1"), ProviderItem(name: "panth", type: "public.folder", identifier: "12334444", parentId: "-1")])
var myInt = 100
let myIntData = Data(bytes: &myInt, count: MemoryLayout.size(ofValue: myInt))
observer.finishEnumerating(upTo: NSFileProviderPage(rawValue: myIntData))
}
observer.didEnumerate()
Finally I figured out the problem here, that if we want to show the files in the root page the NSFileProviderItem
requires it's parent_id as NSFileProviderItemIdentifier.rootContainer
. Setting this solved my problem