Creates a notification request object that you use to schedule a notification.
- iOS 10.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
An identifier for the request; this parameter must not be
nil. You can use this identifier to cancel the request if it is still pending (see the
Pending Notification Requests(with Identifiers:)
The content of the notification. This parameter must not be
The condition that causes the notification to be delivered. Specify
nilto deliver the notification right away.
A new notification request object.
Use this method when you want to schedule the delivery of a local notification. This method creates the request object that you subsequently pass to the
The system uses the
identifier parameter to determine how to handle the request:
If you provide a unique identifier, the system creates a new notification.
If the identifier matches a previously delivered notification, the system alerts the user again, replaces the old notification with the new one, and places the new notification at the top of the list.
If the identifier matches a pending request, the new request replaces the pending request.