Class

UNNotificationContent

The uneditable content of a notification.

Declaration

@interface UNNotificationContent : NSObject

Overview

A UNNotificationContent object contains the data associated with a notification. When your app receives a notification, the associated UNNotificationRequest object contains an object of this type with the content that your app received. Use the content object to get the details of the notification, including the type of notification that was delivered, any custom data you stored in the userInfo dictionary before scheduling the notification, and any attachments.

Don't create instances of this class directly. For remote notifications, the contents of this object are derived from the JSON payload that your server sends to the APNS server. For local notifications, create a UNMutableNotificationContent object, and configure the contents of that object instead.

Topics

Getting the Notification Data

title

A short description of the reason for the alert.

subtitle

A secondary description of the reason for the alert.

body

The message displayed in the notification alert.

badge

The number to display as the app’s icon badge.

sound

The sound to play when the notification is delivered.

launchImageName

The name of the launch image to display when your app is launched in response to the notification

userInfo

A dictionary of custom information associated with the notification.

attachments

An array of attachments to display with the notification.

Setting the Notification Summary

summaryArgument

The string the notification adds to the category’s summary format string.

summaryArgumentCount

The number of items the notification adds to the category’s summary format string.

Identifying the Content

categoryIdentifier

The identifier of the app-defined category object.

threadIdentifier

An identifier that you use to group related notifications together.

Instance Properties

Relationships

Inherits From

See Also

Notification Content

UNMutableNotificationContent

The editable content for a notification.

UNNotificationAttachment

A media file associated with a notification.

UNNotificationSound

The sound played when a notification is delivered.

UNNotificationSoundName

A string providing the name of a sound file.

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