fix notification badge

This commit is contained in:
Ryan Zhao 2022-02-16 16:18:49 +11:00
parent 37edce9a09
commit 7f8c952c66

View file

@ -97,7 +97,7 @@ public final class NotificationServiceExtension : UNNotificationServiceExtension
return self.completeSilenty() return self.completeSilenty()
} }
notificationContent.userInfo = userInfo notificationContent.userInfo = userInfo
notificationContent.badge = 1 notificationContent.badge = NSNumber(value: OWSMessageUtils.sharedManager().unreadMessagesCount() + 1)
let notificationsPreference = Environment.shared.preferences!.notificationPreviewType() let notificationsPreference = Environment.shared.preferences!.notificationPreviewType()
switch notificationsPreference { switch notificationsPreference {
case .namePreview: case .namePreview: