Files
Kisani/App/AppDelegate.swift
Robin Kutesa b96711c535 Initial scaffold — NASBackup iOS app
Full project scaffold: XcodeGen project.yml, Core models/protocols/errors,
SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2),
PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager,
all feature UIs (Login, Connect, Browse, Backup, History, Settings),
Shared components and theme. Builds clean with zero errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 17:05:04 +03:00

35 lines
1.1 KiB
Swift

import UIKit
import BackgroundTasks
import UserNotifications
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
BackgroundTaskManager.registerTasks()
requestNotificationPermission()
setupLANMonitor()
return true
}
private func requestNotificationPermission() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { _, _ in }
}
private func setupLANMonitor() {
let monitor = LANMonitor.shared
monitor.onTrustedNetworkJoined = { ssid in
let store = ConnectionStore.shared
guard store.lanTriggerEnabled, !store.isInQuietHours else { return }
let delay = TimeInterval(store.startDelaySeconds)
BackgroundTaskManager.scheduleBackup(delay: delay)
}
monitor.start()
}
func applicationDidEnterBackground(_ application: UIApplication) {
BackgroundTaskManager.scheduleAppRefresh()
}
}