mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-04 06:58:20 +02:00
Remove call notifications on various points
This commit is contained in:
@@ -30,4 +30,15 @@ import UserNotifications
|
||||
}
|
||||
}
|
||||
|
||||
func removeCallNotifications() {
|
||||
UNUserNotificationCenter.current().getDeliveredNotifications { (notifications) in
|
||||
// get identifiers of notifications whose category identifiers are "TO_BE_REMOVED"
|
||||
let identifiersToBeRemoved = notifications.compactMap({ $0.request.content.categoryIdentifier == Constants.callNotificationsCategoryIdentifier ? $0.request.identifier : nil })
|
||||
|
||||
NSLog("[UNUserNotificationCenter] removeUnwantedNotifications: Removing \(identifiersToBeRemoved.count) notifications.")
|
||||
// remove the notifications with these id's
|
||||
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: identifiersToBeRemoved)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user