修复加密推送角标

This commit is contained in:
Fin 2024-12-11 09:20:34 +08:00
parent 05d6ada326
commit 4a2bf08e6e

View File

@ -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 {