Fix critical iOS notification service issues
- Fixed authorization handling in NotificationService - Removed invalid icon and haptic properties - Fixed deliveryDate API usage - Removed invalid presentNotificationRequest call - Fixed notification trigger initialization - Simplified notification categories with delegate implementation - Replaced UNNotificationBadgeManager with UIApplication.shared.applicationIconBadgeNumber - Eliminated code duplication in badge update logic - Fixed NotificationPreferencesStore JSON encoding/decoding
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import Foundation
|
||||
|
||||
/// Notification preferences data structure
|
||||
@objcMembers
|
||||
class NotificationPreferences: NSObject, Codable {
|
||||
var newArticles: Bool
|
||||
var episodeReleases: Bool
|
||||
var customAlerts: Bool
|
||||
var badgeCount: Bool
|
||||
var sound: Bool
|
||||
var vibration: Bool
|
||||
|
||||
init(
|
||||
newArticles: Bool = true,
|
||||
episodeReleases: Bool = true,
|
||||
customAlerts: Bool = true,
|
||||
badgeCount: Bool = true,
|
||||
sound: Bool = true,
|
||||
vibration: Bool = true
|
||||
) {
|
||||
self.newArticles = newArticles
|
||||
self.episodeReleases = episodeReleases
|
||||
self.customAlerts = customAlerts
|
||||
self.badgeCount = badgeCount
|
||||
self.sound = sound
|
||||
self.vibration = vibration
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user