Class

NSUserNotification

A notification that can be scheduled for display in the notification center.

Declaration

@interface NSUserNotification : NSObject

Overview

When a notification is delivered, information about when the notification was actually presented to the user (if at all) and other details are provided in the notification object. User applications can create NSUserNotification objects and register them with the NSUserNotificationCenter object to notify the user when an application requires attention.

Threading Information

The NSUserNotificationCenter class and the NSUserNotification class are both thread safe.

Topics

Display Information

title

Specifies the title of the notification.

subtitle

Specifies the subtitle of the notification.

informativeText

The body text of the notification.

contentImage

Image shown in the content of the notification.

identifier

A string that uniquely identifies a notification.

response

The response with which the user responded to a notification.

responsePlaceholder

Optional placeholder string for inline reply field.

Displayed Notification Buttons

hasActionButton

A Boolean value that specifies whether the notification displays an action button.

actionButtonTitle

Specifies the title of the action button displayed in the notification.

otherButtonTitle

Specifies a custom title for the close button in an alert-style notification.

hasReplyButton

A Boolean value that specifies whether the notification displays a reply button.

Delivery Timing

deliveryDate

Specifies when the notification should be delivered.

actualDeliveryDate

The date this notification was actually delivered.

deliveryRepeatInterval

Specifies the date components that control how often a user notification is repeated.

deliveryTimeZone

Specify the time zone to interpret the delivery date in.

Delivery Information

presented

Specifies whether the user notification has been presented.

remote

Specifies whether the remote was generated by a push notification.

soundName

Specifies the name of the sound to play when the notification is delivered.

User Notification Activation Method

activationType

Specifies what caused a user notification to occur.

additionalActivationAction

An additional action selected by the user.

additionalActions

The actions that can be taken on a notification in addition to the default action.

User Notification User Information

userInfo

Application-specific user info that can be attached to the notification.

Constants

NSUserNotificationActivationType

These constants describe how the user notification was activated.

NSUserNotificationDefaultSoundName

The default sound played by the user notification center for this notification.

Initializers

Relationships

Inherits From

Conforms To

See Also

User Notifications

NSUserNotificationAction

An action that the user can take in response to receiving a notification.

Deprecated
NSUserNotificationCenter

An object that delivers notifications from apps to the user.

Deprecated
NSUserNotificationCenterDelegate

An interface that enables customizing the behavior of the default notification center.