Dynamically requests a system behavior from the power management system.
- macOS 10.6+
- Mac Catalyst 13.0+
The CFString assertion type to request from the PM system.
Pass kIOPMAssertionLevelOn or kIOPMAssertionLevelOff.
A string that describes the name of the caller and the activity being handled by this assertion (e.g. "Mail Compacting Mailboxes"). Name may be no longer than 128 characters.
On success, a unique id will be returned in this parameter.
Returns kIOReturnSuccess on success, any other return indicates PM could not successfully activate the specified assertion.
No special privileges are necessary to make this call - any process may activate a power assertion. Caller must specify an AssertionName - NULL is not a valid input.