mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 02:29:55 +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:
@@ -24,6 +24,21 @@ struct SettingsScreen: View {
|
||||
var body: some View {
|
||||
NavigationStack(path: path) {
|
||||
Form {
|
||||
#if os(iOS)
|
||||
// iOS suspends the app in the background, so serving/receiving
|
||||
// can't run indefinitely there (unlike macOS). Tell users up
|
||||
// front so the platform limit doesn't read as a bug.
|
||||
Section {
|
||||
VStack(alignment: .leading, spacing: 6) {
|
||||
Label(String(localized: L10n.Settings.iosBackgroundNoticeTitle), systemSymbol: .moonZzz)
|
||||
.font(.subheadline.weight(.semibold))
|
||||
Text(String(localized: L10n.Settings.iosBackgroundNoticeBody))
|
||||
.font(.footnote)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
.padding(.vertical, 2)
|
||||
}
|
||||
#endif
|
||||
Section {
|
||||
NavigationLink(value: SettingsSection.preferences) {
|
||||
SettingsRow(icon: .personCropCircle, title: String(localized: L10n.Preferences.title), value: model.state.username)
|
||||
|
||||
Reference in New Issue
Block a user