Hi there,
I have two extension in my App, a Finder Sync and a Share Extension. Because these are disabled by default and automatically enabling them is, according to my extensive research, not possible, I want to provide an easy way for the user to enable the extensions when the app is opened. I am currently displaying a popup, with a button to open the preferences. I have struggled with this a bit, by now I managed to open the main preferences window using
NSWorkspace.shared.open(URL(string: "x-apple.systempreferences:com.apple.preference")!)
which is rather suboptimal though, since the user has to select the extensions option manually and isn't directly redirected there.
What I have also found is that the menu of the FinderSyncExtension can be opened directly by using FIFinderSyncController.showExtensionManagementInterface()
which is unfortunately suboptimal as well, because it only shows the managment interface of the finder extension and not the overview of all extensions.
Is there any way to either enable the extensions programatically, or if not, is there a way to show the "Added Extensions" portion of the Extensions menu in the system preferences?
After searching through some old forum-posts where this problem is also described, I do not think it is possible. If you have multiple extensions you only have two options:
1 - Simply open the preferences (it is not possible to open the Extensions part of the preferences, for some reason) using the following code:
NSWorkspace.shared.open(URL(string: "x-apple.systempreferences:com.apple.preference")!)
You should display some instructions for the user, telling them where and how to enable your extensions (which is what I resulted to)
2- Result to opening only the config of the Finder Sync Extension using:
FIFinderSyncController.showExtensionManagementInterface()
This is suboptimal though, because the user might only enable one of your extensions.
I really hope that some implementation of opening the extension preferences will be added soon, or that some of the older extension (e.g. Share Extension, in my case) get updated to also include a Controller similar to the FIFinderSyncController
of the Finder Sync extension.