Dialog Description Keys

Keys used in a user notification’s description dictionary, which describes the contents of the notification dialog to display.


When creating the user notification with CFUserNotificationCreate, the description dictionary must have a value for kCFUserNotificationAlertHeaderKey. All other keys are optional.

The button title keys must be given in right-to-left order—you therefore must use the kCFUserNotificationDefaultButtonTitleKey constant for the rightmost button even if it is conceptually not a "default" button (for example, if you want a single "Cancel" button that should not have color, should not pulse, and should not have return for a key equivalent). If, however, you set the kCFUserNotificationNoDefaultButtonFlag, the rightmost button does not behave as a default button (although it will still be the "default" button in the sense of using kCFUserNotificationDefaultButtonTitleKey and kCFUserNotificationDefaultResponse). The following code fragment shows how you can create a notification that contains a single "Cancel" button that does not behave as a default button.

const void* keys[] = {kCFUserNotificationAlertHeaderKey,
const void* values[] = {CFSTR("Progress"),
CFDictionaryRef parameters = CFDictionaryCreate(0, keys, values,
        sizeof(keys)/sizeof(*keys), &kCFTypeDictionaryKeyCallBacks,
SInt32 err = 0;
CFUserNotificationCreate(kCFAllocatorDefault, 0,
        kCFUserNotificationPlainAlertLevel | kCFUserNotificationNoDefaultButtonFlag,
        &err, parameters);

If you set the kCFUserNotificationNoDefaultButtonFlag flag and do not specify a value for kCFUserNotificationDefaultButtonTitleKey, the notification will have no buttons.




A file URL pointing to the icon to display in the dialog.


A file URL pointing to a sound that will be played when the alert appears.


A file URL pointing to a bundle that contains localized versions of the strings displayed in the dialog.


The title of the notification dialog.


The message string to display in the dialog.


The title of the default button.


The title of an optional alternate button.


The title of an optional third button.


A value to indicate the progress of an operation.


The list of strings to display in a pop-up menu.


The list of titles for all the text fields to display.


The list of titles for all the checkboxes or radio buttons to display.


The list of values to put into the text fields. If only one text field is to be displayed, you can pass its value string directly without putting it into an array first.


The item that was selected from a pop-up menu.