From 05e522ac93cd739dfcb69b6c3b89ed48d3662b41 Mon Sep 17 00:00:00 2001 From: Ray Slakinski <19767+rays@users.noreply.github.com> Date: Sun, 8 Nov 2026 14:31:21 -0500 Subject: [PATCH] iOS: ask for the background refresh as the app leaves, too (#421) Build 5. The badge's refresh was requested only when the app came forward; iOS asks for it as the app goes to the background. The request made on coming forward stays. The timing is still iOS's. Co-Authored-By: Claude Sonnet 5.5 --- ios/Sources/App.swift | 6 ++++++ ios/project.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ios/Sources/App.swift b/ios/Sources/App.swift index 1c4b03a..9f0ca49 100644 --- a/ios/Sources/App.swift +++ b/ios/Sources/App.swift @@ -23,6 +23,12 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate { self.window = window } + /// iOS wants the request made as the app leaves, with the user's last look at the list; the + /// one made on coming forward stays for a run that was cut short. + func sceneDidEnterBackground(_ scene: UIScene) { + Badge.scheduleBackgroundRefresh() + } + func sceneDidBecomeActive(_ scene: UIScene) { Badge.requestPermission() Badge.scheduleBackgroundRefresh() diff --git a/ios/project.yml b/ios/project.yml index d1d506a..365410b 100644 --- a/ios/project.yml +++ b/ios/project.yml @@ -25,7 +25,7 @@ targets: properties: CFBundleDisplayName: iPX CFBundleShortVersionString: $(MARKETING_VERSION) - CFBundleVersion: "4" + CFBundleVersion: "5" # Playing on with the screen locked. A plist key, not a signed entitlement, so it works on # a free personal team; CarPlay's own dashboard app is an entitlement Apple has to grant. UIBackgroundModes: [audio, fetch]