From f045a5d339a796f40a9e958436ebc6f5314bdab8 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Thu, 23 Apr 2026 22:15:20 -0500 Subject: feat(v3.4.0): add backup, restore, and data portability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • introduce versioned DomainDig backup format • add full backup export/import with merge and replace modes • implement data validation and conflict handling • add partial exports for tracked domains, workflows, and history • add Data Portability settings section • support Files/iCloud Drive import and export • harden migrations for evolving local models • extend CLI with backup export and validation --- DomainDig/LocalNotificationService.swift | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'DomainDig/LocalNotificationService.swift') diff --git a/DomainDig/LocalNotificationService.swift b/DomainDig/LocalNotificationService.swift index 450d844..7b43d67 100644 --- a/DomainDig/LocalNotificationService.swift +++ b/DomainDig/LocalNotificationService.swift @@ -27,6 +27,18 @@ final class LocalNotificationService { } } + func isAuthorizedForAlerts() async -> Bool { + let settings = await UNUserNotificationCenter.current().notificationSettings() + switch settings.authorizationStatus { + case .authorized, .provisional, .ephemeral: + return true + case .denied, .notDetermined: + return false + @unknown default: + return false + } + } + func notifyDomainEvent(domain: String, message: String, severity: ChangeSeverity) async { await schedule( identifier: "domain-change-\(domain)", @@ -45,6 +57,27 @@ final class LocalNotificationService { ) } + func notifyMonitoringAlert( + domain: String, + message: String, + severity: MonitoringAlertSeverity + ) async { + let interruptionLevel: UNNotificationInterruptionLevel + switch severity { + case .critical: + interruptionLevel = .timeSensitive + case .warning, .info: + interruptionLevel = .active + } + + await schedule( + identifier: "monitoring-\(domain)-\(UUID().uuidString)", + title: domain, + body: message, + interruptionLevel: interruptionLevel + ) + } + func notifySweepComplete(summary: BatchSweepSummary) async { let body = "\(summary.changedDomains) changed, \(summary.warningDomains) warnings, \(summary.unchangedDomains) unchanged" await schedule( -- cgit v1.2.3