I have a system preference pane that contains a background-only app that it wants to set as a login item. I understand that the proper way to set up login items in Ventura is by using the new SMAppService
framework. In order to do so, I need an instance of SMAppService
. I can't create it using +[SMAppService loginItemServiceWithIdentifier:]
, because that assumes that the login item is embedded in the calling app, and in this case the calling app is System Preferences. That leaves having the app itself get the mainAppService
class property. But when I do that, and then ask the service for its status
, the result is SMAppServiceStatusNotFound
. That's documented as:
An error occurred and the framework couldn’t find this service.
What kind of error??? When I try this, I see some messages in Console from the tccd
process that look like they might be related, but they don't clarify what's wrong.
Must I just give up on using a system preference pane, and make my utility a plain old app containing a helper app?