Supporting move to trash in a file provider for macOS

I am trying to implement a file provider for macOS. I’ve been using the Fruit Basket demo project provided by Apple to help me figure out how this can be done. I have met with some success, in that I can get directories of files to show up. 

I now want to be able to support being able to delete files. I can do this from the command line, however when trying to access the context menu for an item in my file system through the Finder, there is no option to delete or move the item to the trash. In the Fruit Basket demo project, any domains created there have the option to move their items to the trash through the Finder. So far, I have been unable to figure out why this works for Fruit Basket and not for my application.

How can someone allow their file provider to support moving items to the trash?

Note: The Fruit Basket project is designed to be built and run on macOS 12 (Monterey). I’m creating my file provider for macOS 11 (Big Sur).

Okay,  I think I figured it out. It appears that for any item that will support moving to the trash, its corresponding NSFileProviderItem implementation has to have the capabilities property include the allowsTrashing option.

Supporting move to trash in a file provider for macOS
 
 
Q