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>
This commit is contained in:
34
App/AppDelegate.swift
Normal file
34
App/AppDelegate.swift
Normal file
@@ -0,0 +1,34 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user