From 4a2bf08e6ebd99d42757e6a5fcae5b823c7371ac Mon Sep 17 00:00:00 2001 From: Fin Date: Wed, 11 Dec 2024 09:20:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A0=E5=AF=86=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E8=A7=92=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Processor/CiphertextProcessor.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NotificationServiceExtension/Processor/CiphertextProcessor.swift b/NotificationServiceExtension/Processor/CiphertextProcessor.swift index b70ac224..eea799ea 100644 --- a/NotificationServiceExtension/Processor/CiphertextProcessor.swift +++ b/NotificationServiceExtension/Processor/CiphertextProcessor.swift @@ -41,8 +41,8 @@ class CiphertextProcessor: NotificationContentProcessor { soundName = sound bestAttemptContent.sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: sound)) } - if let badge = map["badge"] as? Int { - bestAttemptContent.badge = badge as NSNumber + if let badge = map["badge"] as? String, let badgeValue = Int(badge) { + bestAttemptContent.badge = badgeValue as NSNumber } var aps: [String: Any] = ["alert": alert] if let soundName {