From bf3d9129e05cb732f094d6f9d4cf125424dbd3d9 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Tue, 23 Feb 2021 15:22:33 +0100 Subject: [PATCH] fix show app's badge --- msgNotificationService/NotificationService.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/msgNotificationService/NotificationService.swift b/msgNotificationService/NotificationService.swift index 6650360b2..cbd4ff5ce 100644 --- a/msgNotificationService/NotificationService.swift +++ b/msgNotificationService/NotificationService.swift @@ -89,7 +89,9 @@ class NotificationService: UNNotificationServiceExtension { if let message = message { let msgData = parseMessage(message: message) - if !message.isUsingUserDefaults, let badge = updateBadge() as NSNumber? { + // Extension only upates app's badge when main shared core is Off = extension's core is On. + // Otherwise, the app will update the badge. + if lc?.globalState == GlobalState.On, let badge = updateBadge() as NSNumber? { bestAttemptContent.badge = badge }