getDeliveredNotifications(completionHandler:)
Fetches all of your app’s delivered notifications that are still present in Notification Center.
Declaration
func getDeliveredNotifications(completionHandler: @escaping @Sendable ([UNNotification]) -> Void)func deliveredNotifications() async -> [UNNotification]Parameters
- completionHandler:
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:
- notifications
An array of Unnotification objects representing the local and remote notifications of your app that have been delivered and are still visible in Notification Center. If none of your app’s notifications are visible in Notification Center, the array is empty.
Discussion
This method executes asynchronously, returning immediately and executing the provided block on a background thread when the results become available.