mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 10:29:58 +02:00
feat(apple): keep iOS transfers alive in the background
iOS suspends the process on backgrounding, freezing the core's network threads so in-flight transfers stall and never fire notifications. Hold a UIApplication background-task assertion (BackgroundActivityController) while transfers/shares are active so iOS grants its grace window — long enough to finish and notify. Released on foreground, on completion, or on expiration. No UIBackgroundModes added (keeps App Store validation clean); macOS is a no-op since it already runs unfocused. Add a localized iOS-only Settings notice explaining the platform limit so it doesn't read as a bug.
This commit is contained in:
@@ -13,6 +13,7 @@ final class AppGraph: ObservableObject {
|
||||
let filePreviewRepository: FilePreviewRepository
|
||||
let approvalCoordinator: ApprovalCoordinator
|
||||
let transferNotificationCoordinator: TransferNotificationCoordinator
|
||||
let backgroundActivity: BackgroundActivityController
|
||||
|
||||
init(dependencies: AppDependencies, coreRepository: CoreRepository? = nil) {
|
||||
self.dependencies = dependencies
|
||||
@@ -39,6 +40,7 @@ final class AppGraph: ObservableObject {
|
||||
visibility: visibility,
|
||||
messages: messages
|
||||
)
|
||||
self.backgroundActivity = BackgroundActivityController(repository: coreRepository)
|
||||
AppLogger.info("lifecycle", "graph created", ["platform": dependencies.environment.name])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user