Schedules a local notification for delivery.
- iOS 10.0+
- macOS 10.14+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
The request object containing the notification payload and trigger information. This parameter must not be
The block to execute with the results. This block may be executed on a background thread. The block has no return value and takes the following parameter:
An error object indicating whether a problem occurred. If the notification was scheduled successfully, this parameter is
nil; otherwise, it is set to an error object indicating the reason for the failure.
This method schedules local notifications only; you cannot use it to schedule the delivery of remote notifications. Upon calling this method, the system begins tracking the trigger conditions associated with your request. When the trigger condition is met, the system delivers your notification. If the request does not contain a
UNNotification object, the notification is delivered right away.
You may call this method from any thread of your app.