Instance Property

sound

The sound to play when the notification is delivered.

Declaration

iOS, Mac Catalyst, watchOS
@property(copy, nonatomic) UNNotificationSound *sound;
macOS
@property(copy, atomic) UNNotificationSound *sound;

Discussion

Use this property to specify the sound that you want played when the notification arrives. If your app is not authorized to play sounds for notifications, this property is ignored.

For information on how to specify sounds for your notifications, see UNNotificationSound.

See Also

Getting the Notification Data

title

The localized title, containing the reason for the alert.

subtitle

The localized subtitle, containing a secondary description of the reason for the alert.

body

The localized message to display in the notification alert.

badge

The number to apply to the app’s icon.

launchImageName

The name of the custom 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 in an alert-based notification.

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