Instance Property

badge

The number to apply to the app’s icon.

Declaration

iOS, Mac Catalyst, tvOS, watchOS
@property(copy, nonatomic) NSNumber *badge;
macOS
@property(copy, atomic) NSNumber *badge;

Discussion

Use this property to specify the number to apply to the app’s icon when the notification arrives. If your app is not authorized to display badge-based notifications, this property is ignored.

Specify the number 0 to remove the current badge, if present. Specify a number greater than 0 to display a badge with that number. Specify nil to leave the current badge unchanged.

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.

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.