Add push-equivalent notifications via background polling; bump to 3.6
Build iOS App / Build .ipa and publish source (push) Successful in 31s
Build iOS App / Build .ipa and publish source (push) Successful in 31s
Sideloaded apps can't use APNs (no push entitlement without Apple signing), so deliver notifications via an iOS BGAppRefreshTask that polls the monitored repos every ~15 min and fires local notifications (no Apple push needed): - new PRs that appear in the open set - CI status changes on existing PRs Persistence: NotificationState tracks announced PR ids + last-known CI status so we only fire on actual changes, not every poll. AppDelegate registers the background task and reschedules the next one. Info.plist gets UIBackgroundModes fetch + the BGTask identifier. Settings gains a Notifications toggle; also poll after a foreground inbox load so state seeds and changes are caught promptly. Bump to 3.6.
This commit is contained in:
1 parent
6ed50ecc4a
commit
bae531f850
8 files changed
+241
-4
No files matched your search
@@ -36,6 +36,11 @@ final class SettingsStore: ObservableObject {
|
||||
/// Set when a PR is merged, so the inbox knows to reload on next appearance
|
||||
/// (otherwise a just-merged PR could linger as stale in the list).
|
||||
@Published var inboxNeedsRefresh = false
|
||||
/// Whether background polling for push-equivalent notifications is on.
|
||||
@Published var notificationsEnabled: Bool {
|
||||
didSet { UserDefaults.standard.set(notificationsEnabled,
|
||||
forKey: "notificationsEnabled") }
|
||||
}
|
||||
|
||||
private init() {
|
||||
instanceURL = KeychainHelper.get("instanceURL") ?? "https://gitea.bueso.eu"
|
||||
@@ -44,6 +49,7 @@ final class SettingsStore: ObservableObject {
|
||||
mergeGateMode = MergeGateMode(rawValue: raw ?? "") ?? .warn
|
||||
deleteBranchAfterMerge = UserDefaults.standard.bool(forKey: "deleteBranchAfterMerge")
|
||||
monitoredRepos = UserDefaults.standard.stringArray(forKey: "monitoredRepos") ?? []
|
||||
notificationsEnabled = UserDefaults.standard.object(forKey: "notificationsEnabled") as? Bool ?? false
|
||||
}
|
||||
|
||||
var isConfigured: Bool {
|
||||
|
||||
Reference in new issue
Block a user