I'm currently trying to implement local notifications into my app and ran into the issue of not being able to increase the badge counter past 1 for some reason.
Here is my method for configuring and scheduling notifications.
func scheduleNotification() {
let content = UNMutableNotificationContent()
content.title = "\(self.title == "" ? "Title" : self.title) is done"
content.subtitle = "Tap to view"
content.sound = UNNotificationSound.default
content.badge = 1
if self.isPaused {
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: self.currentTime, repeats: false)
let request = UNNotificationRequest(identifier: self.notificationIdentifier.uuidString, content: content, trigger: trigger)
UNUserNotificationCenter.current().add(request)
} else {
removeNotification()
}
}
For some reason, when multiple notifications are successfully scheduled and indeed delivered, the badge counter only increases up to 1, regardless of the actual number of delivered notifications.
Is there a proper way to manage the badge count and this just ain't it?