Platforms to show: All Mac Windows Linux Cross-Platform
SMAppServiceMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Login Items | MBS MacCF Plugin | 23.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | All |
In macOS 13 and later, use SMAppService to register and control LoginItems, LaunchAgents, and LaunchDaemons as helper executables for your app. When converting code from earlier versions of macOS, use an SMAppService object and select one of the following methods depending on the type of service your helper executable provides:
- For SMAppServices initialized as LoginItems, the register and unregister APIs provide a replacement for SMLoginItemSetEnabled.
- For SMAppServices initialized as LaunchAgents, the register and unregister methods provide a replacement for installing property lists in ~/Library/LaunchAgents or /Library/LaunchAgents.
- For SMAppServices initialized as LaunchDaemons, the register and unregister methods provide a replacement for installing property lists in /Library/LaunchDaemons.
Requires macOS 13.0.
- 2 properties
- 4 methods
- method Constructor
- method register(byref error as NSErrorMBS) as Boolean
- method unregister(byref error as NSErrorMBS) as Boolean
- method unregister(CompleteHandler as SMAppServiceUnregisterCompletedMBS, tag as variant = nil)
- 7 shared methods
- shared method agentService(plistName as String) as SMAppServiceMBS
- shared method daemonService(plistName as String) as SMAppServiceMBS
- shared method loginItemService(identifier as String) as SMAppServiceMBS
- shared method mainAppService as SMAppServiceMBS
- shared method openSystemSettingsLoginItems
- shared method statusForLegacyFile(File as FolderItem) as Integer
- shared method statusForLegacyURL(URL as String) as Integer
- delegate SMAppServiceUnregisterCompletedMBS(Error as NSErrorMBS, Tag as Variant)
- 4 constants
Service Status
Constant | Value | Description |
---|---|---|
SMAppServiceStatusEnabled | 1 |
The service has been successfully registered and is eligible to run. |
SMAppServiceStatusNotFound | 3 |
An error occurred and the framework couldn’t find this service. |
SMAppServiceStatusNotRegistered | 0 |
The service hasn’t registered with the Service Management framework, or the service attempted to reregister after it was already registered. |
SMAppServiceStatusRequiresApproval | 2 | The service has been successfully registered, but the user needs to take action in System Preferences. more |
This class has no sub classes.
Blog Entries
The items on this page are in the following plugins: MBS MacCF Plugin.
SLRequestMBS - SmartCardContextMBS