Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UNUserNotificationCenter.current().getDeliveredNotifications only returns empty array

I am trying to retrieve all delivered notifications still showing in the notification center but UNUserNotificationCenter getDeliveredNotifications(completionHandler:) just doesn't work. I can get all the pending notifications with UNUserNotificationCenter getPendingNotificationRequests(completionHandler:) but getDeliveredNotifications will simply always return a 0 count even though there are notifications on the notification center.

like image 529
cauende Avatar asked Nov 08 '22 12:11

cauende


1 Answers

According to this: NUserNotificationCenter.current().getDeliveredNotifications only ever returns an empty array

Setting the badge number to 0 will clear your remote notifications.

Could that be the problem?

like image 149
berrste Avatar answered Nov 29 '22 07:11

berrste