Instance Method

getDeliveredNotifications(completionHandler:)

Returns 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 notification requests from Notification Center.

func removeAllDeliveredNotifications()

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software