File Provider API on macOS: How to initialize?

608 views Asked by At

I am trying to build a macOS application from scratch that makes use of the new File Provider API shipped with macOS Big Sur. Luckily, the latest version of Xcode, version 12.5 beta 3, comes with a File Provider Extension that I can easily add to my macOS app (via File, New..., Target..., File Provider Extension).

What is unclear to me is how and where to initialize this file provider API. I've tried to do this in AppDelegate.swift based on some code I've found on the Internet. But when I start the app, I get the following code logged to the debug console in Xcode:

2021-04-13 17:19:57.760716+0200 GiraffeApp[30325:1559029] GiraffeApp starting
2021-04-13 17:19:57.854440+0200 GiraffeApp[30325:1559463] Successfully removed all domains
2021-04-13 17:19:57.893298+0200 GiraffeApp[30325:1559458] signalEnumerator failed: No valid file provider found with identifier com.foo.GiraffeApp.GiraffeFileProvider/GiraffeDomain.
2021-04-13 17:19:57.906521+0200 GiraffeApp[30325:1559458] Unable to add file provider domain: The file couldn’t be saved because a file with the same name already exists.

I do not understand why the file provider cannot be found, as it is (or at least should be) embedded in the project. The extension is sandboxed (seems to be a requirement too) and the app is codesigned with my dev certificate. I can also not see anything shown in the Finder Locations section.

In order to not have to post multiple pages of source code here, I have put the code to GitHub . Thanks for having a look! Any help on this is highly appreciated.

0

There are 0 answers