CNUserNotification Class Reference
Inherits from | NSObject |
Conforms to | NSCopying |
Declared in | CNUserNotification.h |
Tasks
Display Information
-
title
Specifies the title of the notification.
property -
subtitle
Specifies the subtitle of the notification.
property -
informativeText
The body text of the notification.
property
Displayed Notification Buttons
-
hasActionButton
Specifies whether the notification displays an action button.
property -
actionButtonTitle
Specifies the title of the action button displayed in the notification.
property -
otherButtonTitle
Specifies a custom title for the close button in an alert-style notification.
property
User Delivery Information
-
soundName
Specifies the name of the sound to play when the notification is delivered.
property
User Notification Activation Method
-
activationType
Specifies what caused a user notification to occur. (read-only)
property
User Notification User Information
-
userInfo
Application-specific user info that can be attached to the notification.
property
User Notification Additional Features
-
– feature
Returns the CNUserNotificationFeature extension object.
-
– setFeature:
Sets the CNUserNotificationFeature extension object.
Properties
actionButtonTitle
Specifies the title of the action button displayed in the notification.
@property (copy) NSString *actionButtonTitle
Discussion
This value should localized as it will be presented to the user. The string will be truncated to a length appropriate for display and the property will be modified to reflect the truncation.
Declared In
CNUserNotification.h
activationType
Specifies what caused a user notification to occur. (read-only)
@property (readonly) CNUserNotificationActivationType activationType
Discussion
This property specifies why the user notification was sent to to the CNUserNotificationCenterDelegate method
userNotificationCenter:didActivateNotification:
.
The supported values are described in CNUserNotificationActivationType
.
typedef NS_ENUM (NSInteger, CNUserNotificationActivationType) {
CNUserNotificationActivationTypeNone = 0,
CNUserNotificationActivationTypeContentsClicked,
CNUserNotificationActivationTypeActionButtonClicked
} NS_ENUM_AVAILABLE (10_7, NA);
Declared In
CNUserNotification.h
hasActionButton
Specifies whether the notification displays an action button.
@property BOOL hasActionButton
Discussion
Set to NO
if the notification has no action button. This will be the case for notifications that are purely for
informational purposes and have no user action.
The default value is YES
.
Declared In
CNUserNotification.h
informativeText
The body text of the notification.
@property (copy) NSString *informativeText
Discussion
This value should localized as it will be presented to the user. The string will be truncated to a length appropriate for display and the property will be modified to reflect the truncation.
See Also
Declared In
CNUserNotification.h
otherButtonTitle
Specifies a custom title for the close button in an alert-style notification.
@property (copy) NSString *otherButtonTitle
Discussion
This value should localized as it will be presented to the user. The string will be truncated to a length appropriate for display and the property will be modified to reflect the truncation.
An empty string will cause the default localized text to be used. A nil
value is invalid.
Declared In
CNUserNotification.h
soundName
Specifies the name of the sound to play when the notification is delivered.
@property (copy) NSString *soundName
Discussion
Passing the NSUserNotificationDefaultSoundName
constant causes the default notification center sound to be played.
A value of nil means no sound is played.
Default value is nil
.
Declared In
CNUserNotification.h
subtitle
Specifies the subtitle of the notification.
@property (copy) NSString *subtitle
Discussion
This value should localized as it will be presented to the user. The string will be truncated to a length appropriate for display and the property will be modified to reflect the truncation.
See Also
Declared In
CNUserNotification.h
title
Specifies the title of the notification.
@property (copy) NSString *title
Discussion
This value should localized as it will be presented to the user. The string will be truncated to a length appropriate for display and the property will be modified to reflect the truncation.
Declared In
CNUserNotification.h
Instance Methods
feature
Returns the CNUserNotificationFeature extension object.
- (CNUserNotificationFeature *)feature
Declared In
CNUserNotification.h
setFeature:
Sets the CNUserNotificationFeature extension object.
- (void)setFeature:(CNUserNotificationFeature *)theFeature
Declared In
CNUserNotification.h