What is funny, though, is that "removing the badge" in the extension seems to fix the issue, at least temporarily.
If if remove the variable under "badge" (NSNumber) the notification seems to work. It's only the "zero" value that causes the issue.
I will update the ticket as well.
class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if let bestAttemptContent = bestAttemptContent {
if let badge = bestAttemptContent.badge, badge.intValue < 1 {
bestAttemptContent.badge = nil
}
contentHandler(bestAttemptContent)
}
else {
contentHandler(request.content)
}
}