Instance Method

getDeliveredNotifications(completionHandler:)

Provides you with a list of the app’s notifications that are still displayed in Notification Center.

Declaration

func getDeliveredNotifications(completionHandler: @escaping ([UNNotification]) -> Void)

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.

See Also

Managing Delivered Notifications

func removeDeliveredNotifications(withIdentifiers: [String])

Removes the specified notifications from Notification Center.

func removeAllDeliveredNotifications()

Removes all of the app’s notifications from Notification Center.