I have an app with multiple local notifications. When I try to clear all the delivered notifications, I call this removeAllDeliveredNotifications
method. It's working fine till ios 11.1
. In ios 11.2
and above, it doesn't work as expected. The notification still remains in the notification center. Could someone please help me out on this.
Thanks in advance.
It is still working for us. I just checked it on iOS 11.2.2. I am using
removeDeliveredNotificationsWithIdentifiers:
insidegetDeliveredNotificationsWithCompletionHandler:
, callinggetDeliveredNotificationsWithCompletionHandler
on Main Thread.Though I experience strange behavior if I am debugging the completionHandler. If a pause too long (whatever that means) the completion handler will not finish (even on continue process execution) resulting in an unresponsive app. Maybe the completionhandler gets terminated.
This appears to be a bug in iOS that was fixed in iOS 11.3.
Did you try using this method:
removeDeliveredNotifications(withIdentifiers:)
You will need to pass an array of all the notification identifiers that you need to delete.