The number to apply to the app’s icon.
SDKs
- iOS 10.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
Framework
- User
Notifications
Declaration
@NSCopying var badge: NSNumber? { get set }
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.