Using new local notifications from UNUserNotificationCenter
.
I try to delete notification with some identifiers:
UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: identifiers)
and from documention:
This method executes asynchronously, removing the pending notification requests on a secondary thread.
Completion handler is not present. So how do I know when its really get deleted? Before moving ahead, I need to make sure that this identifier is not present anymore.
I know I can use next code
notificationCenter.getPendingNotificationRequests { (requests) in
for request in requests {
}
}
But if I run this code right after removing - they are still there. But after some time and later in the code they are gone. Especially its important before adding new one when you re about to rich the limit of 64 notifications