Declares that the user is active on the system. This causes the display to power on and postpone display sleep up to the user's display sleep Energy Saver settings. If you prefer to hold the display awake for a longer period and you know how long you'd like to hold it, consider taking assertion kIOPMAssertionTypePreventUserIdleDisplaySleep using IOPMAssertionCreateWithDescription API instead.


IOReturn IOPMAssertionDeclareUserActivity(CFStringRef AssertionName, IOPMUserActiveType userType, IOPMAssertionID *AssertionID);



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.


This parameter specifies if the active user is located locally in front of the system or connected to the system over the network. Various components of the system are maintained at different power levels depending on user location.


On Success, unique id will be returned in this parameter. Caller may call this function again with the unique id retured previously to report continous user activity. The unique id returned by this function may change on each call depending on how frequently this function call is repeated and the current display sleep timer value. If you make this call more than once, track the returned value for assertionID, and pass it in as an argument on each call.

Return Value

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 call this API. Caller must specify an AssertionName - NULL is not a valid input.

See Also



Copies details about an IOPMAssertion


Dynamically requests a system behavior from the power management system.


Dynamically requests a system behavior from the power management system.


Creates an IOPMAssertion with more flexibility than IOPMAssertionCreateWithDescription.


Decrements the assertion's retain count.


Increments the assertion's retain count.


Sets a property in the assertion.


Returns a dictionary listing all assertions, grouped by their owning process.


Returns a list of available assertions and their system-wide levels.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software