- 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
29 lines
735 B
Swift
29 lines
735 B
Swift
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
|
|
}
|
|
}
|