mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Always set the push notification badge, even if the unread count is missing.
This commit is contained in:
@@ -43,9 +43,7 @@ class NotificationHandler {
|
|||||||
MXLog.info("\(tag) Processing event: \(eventID) in room: \(roomID)")
|
MXLog.info("\(tag) Processing event: \(eventID) in room: \(roomID)")
|
||||||
|
|
||||||
// Copy over the unread information to the notification badge
|
// Copy over the unread information to the notification badge
|
||||||
if let unreadCount = notificationContent.unreadCount {
|
notificationContent.badge = notificationContent.unreadCount as NSNumber?
|
||||||
notificationContent.badge = NSNumber(value: unreadCount)
|
|
||||||
}
|
|
||||||
|
|
||||||
guard let notificationItemProxy = await userSession.notificationItemProxy(roomID: roomID, eventID: eventID) else {
|
guard let notificationItemProxy = await userSession.notificationItemProxy(roomID: roomID, eventID: eventID) else {
|
||||||
MXLog.error("\(tag) Failed retrieving notification item")
|
MXLog.error("\(tag) Failed retrieving notification item")
|
||||||
@@ -83,10 +81,7 @@ class NotificationHandler {
|
|||||||
MXLog.info("\(tag) Discarding notification")
|
MXLog.info("\(tag) Discarding notification")
|
||||||
|
|
||||||
let content = UNMutableNotificationContent()
|
let content = UNMutableNotificationContent()
|
||||||
|
content.badge = notificationContent.unreadCount as NSNumber?
|
||||||
if let unreadCount = notificationContent.unreadCount {
|
|
||||||
content.badge = NSNumber(value: unreadCount)
|
|
||||||
}
|
|
||||||
|
|
||||||
contentHandler(content)
|
contentHandler(content)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user