Instance Property

body

The localized message to display in the notification alert.

Declaration

iOS, Mac Catalyst, watchOS
@property(copy, nonatomic) NSString *body;
macOS
@property(copy, atomic) NSString *body;

Discussion

Use this property to specify the body of the notification alert. If your app is not authorized to display alert-based notifications, this property is ignored.

The body text should contain the final text that you want to display, and should not contain any placeholder characters. To include a percent symbol (%) in the message body, use two percent symbols (%%). The system strips all other printf style escape characters from your string prior to display.

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.

badge

The number to apply to the app’s icon.

sound

The sound to play when the notification is delivered.

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.