← All repositories

reportage

A life-logging app for iPhone

git clone https://code.inqk.net/reportage.git


commit 9cfb22ca72e45815a9476075315da1cc2bc754e2
parent e5421790b550a82552d666dcaed56d9202cec979
Author: Michael Camilleri <[email protected]>
Date:   Tue, 20 Oct 2026 15:54:52 +0900

Remove app badging

Diffstat

MNotes/Design.md | 6+++---
MReportage.xcodeproj/project.pbxproj | 4----
MReportage/AppDelegate.swift | 1-
DReportage/Services/AppBadge.swift | 12------------
MReportage/Services/FirstLaunch.swift | 9++++-----
MReportage/Services/InstantReportLogger.swift | 1-
MReportage/Views/Home/HomeView.swift | 7++++---
MReportage/Views/Report/ReportDetailView.swift | 1-
MReportage/Views/Settings/DataSection.swift | 1-
MReportage/Views/Settings/NotificationsView.swift | 9+++------
MReportage/Views/WelcomeView.swift | 3+--

11 files changed, 15 insertions(+), 39 deletions(-)

diff --git a/Notes/Design.md b/Notes/Design.md

@@ -560,7 +560,7 @@ Settings.
 
 The first time the app is opened, a welcome screen says what Reportage does
 and why it will ask for location and notifications; Continue asks for
-location, then notifications (alert, sound and badge). Reporting is the app's purpose and every report
+location, then notifications (alert and sound). Reporting is the app's purpose and every report
 records its location, so a report made before the user had decided, or that
 went without, would look like the app not working. Location is asked for as
 'Always', which iOS shows as the usual 'While Using' prompt; choosing that
@@ -582,8 +582,8 @@ overwritten.
 A passive report is saved as soon as it's logged, so it's in the timeline at
 once, and its context is added when the capture finishes (`PassiveLog`). The
 home screen's quick log button, a bolt beside the +, makes one without
-opening the survey. The badge counts passive reports; it shows only once
-notifications are allowed, and could become a setting.
+opening the survey. The app icon isn't badged: an instant report is a
+finished record, not something left to do.
 
 Any finished report can be edited the same way, with **Edit** in its detail
 view. The survey shows the questions the report answered, in its order and

diff --git a/Reportage.xcodeproj/project.pbxproj b/Reportage.xcodeproj/project.pbxproj

@@ -46,7 +46,6 @@
 		7A6543B7C48EC93D468EBBD8 /* PlacePhrase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 577EC17EF58F65207B7EA15D /* PlacePhrase.swift */; };
 		7ACDA81EC3D7811F891CA029 /* ReportSummary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BBAB5AD6266B8F6E3507AE3 /* ReportSummary.swift */; };
 		811704907EE199CC627F0CE5 /* BackgroundLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC0EF3DA62941ED76148D5BF /* BackgroundLocation.swift */; };
-		81B485BD03549DE6E7AA94A7 /* AppBadge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7CE5E7D863F9BD3DF363AA9A /* AppBadge.swift */; };
 		83E954F0DAC9719D2AA02111 /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36C7E4E96538BB14AD6956CA /* HomeView.swift */; };
 		85A36A88AB170F0EAC0DAC03 /* QuestionPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A77AE6DE479403D1D4C9CF /* QuestionPage.swift */; };
 		85C5BF024F19B11DBB616B5F /* ReportageWidgets.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 7EE78E311E8D8AF275123A3E /* ReportageWidgets.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
@@ -174,7 +173,6 @@
 		76FFC5FE874467974DD6BFA0 /* PlaceRanking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceRanking.swift; sourceTree = "<group>"; };
 		798E1DE82BD53EC5BEBA76B7 /* ReporterImportPlan.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReporterImportPlan.swift; sourceTree = "<group>"; };
 		7ABE75DB46245AFDE8A44A48 /* Config.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
-		7CE5E7D863F9BD3DF363AA9A /* AppBadge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppBadge.swift; sourceTree = "<group>"; };
 		7CE9EDC8448889EB9D4D358E /* FirstLaunch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstLaunch.swift; sourceTree = "<group>"; };
 		7DB6FF151DCEBC3913131834 /* ReportageExportTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportageExportTests.swift; sourceTree = "<group>"; };
 		7EDD39E85D86AFF45B5672F3 /* ReportageWidgets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportageWidgets.swift; sourceTree = "<group>"; };
@@ -362,7 +360,6 @@
 		60B58F5030E4A690025C51F5 /* Services */ = {
 			isa = PBXGroup;
 			children = (
-				7CE5E7D863F9BD3DF363AA9A /* AppBadge.swift */,
 				EC0EF3DA62941ED76148D5BF /* BackgroundLocation.swift */,
 				7CE9EDC8448889EB9D4D358E /* FirstLaunch.swift */,
 				729C291798F29C69029E7DB7 /* InstantReportLogger.swift */,
@@ -702,7 +699,6 @@
 			buildActionMask = 2147483647;
 			files = (
 				9F26886E122721BB3F2AFE7F /* AboutView.swift in Sources */,
-				81B485BD03549DE6E7AA94A7 /* AppBadge.swift in Sources */,
 				B454D3067CD611AE55E30A1D /* AppDelegate.swift in Sources */,
 				E8C13757BF3E2C8384F104A1 /* AppleWeather.swift in Sources */,
 				811704907EE199CC627F0CE5 /* BackgroundLocation.swift in Sources */,

diff --git a/Reportage/AppDelegate.swift b/Reportage/AppDelegate.swift

@@ -64,7 +64,6 @@ final class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCent
             log.error("Couldn't respond to a prompt: \(error)")
         }
         // An action is a chance to top up the prompts.
-        await AppBadge.update(from: store)
         await PromptScheduler().refresh()
     }
 }

diff --git a/Reportage/Services/AppBadge.swift b/Reportage/Services/AppBadge.swift

@@ -1,12 +0,0 @@
-import UserNotifications
-
-/// The app icon's badge: the number of reports logged for later.
-enum AppBadge {
-    /// Sets the badge from the store. The badge only shows once the user
-    /// has allowed notifications, which Reportage asks for when it's first
-    /// opened; until then this does nothing visible.
-    static func update(from store: ReportStore?) async {
-        guard let store, let count = try? await store.passiveCount() else { return }
-        try? await UNUserNotificationCenter.current().setBadgeCount(count)
-    }
-}

diff --git a/Reportage/Services/FirstLaunch.swift b/Reportage/Services/FirstLaunch.swift

@@ -36,9 +36,9 @@ enum FirstLaunch {
     /// Asks for each permission still undecided, one after the other, and
     /// remembers that they've been asked for.
     @MainActor
-    static func ask(store: ReportStore?, defaults: UserDefaults = .standard) async {
+    static func ask(defaults: UserDefaults = .standard) async {
         await askForLocation()
-        await askForNotifications(store: store)
+        await askForNotifications()
         await HealthAccess.ask(defaults: defaults)
         defaults.set(true, forKey: key)
     }
@@ -62,16 +62,15 @@ enum FirstLaunch {
         log.info("Asked for location: status \(CLLocationManager().authorizationStatus.rawValue)")
     }
 
-    private static func askForNotifications(store: ReportStore?) async {
+    private static func askForNotifications() async {
         let center = UNUserNotificationCenter.current()
         guard await center.notificationSettings().authorizationStatus == .notDetermined else { return }
-        let granted = (try? await center.requestAuthorization(options: [.alert, .sound, .badge])) ?? false
+        let granted = (try? await center.requestAuthorization(options: [.alert, .sound])) ?? false
         log.info("Asked for notifications: \(granted ? "allowed" : "not allowed")")
         guard granted else { return }
         var settings = PromptSettings.load()
         settings.isEnabled = true
         settings.save()
         await PromptScheduler().refresh()
-        await AppBadge.update(from: store)
     }
 }

diff --git a/Reportage/Services/InstantReportLogger.swift b/Reportage/Services/InstantReportLogger.swift

@@ -12,7 +12,6 @@ struct InstantReportLogger: InstantReportLogging {
         Self.log.info("Filing an instant report from an intent")
         try await PassiveLog(store: store, capture: { await ContextCapture.background.capture() })
             .log(trigger: .intent)
-        await AppBadge.update(from: store)
         await PromptScheduler().refresh()
     }
 }

diff --git a/Reportage/Views/Home/HomeView.swift b/Reportage/Views/Home/HomeView.swift

@@ -1,6 +1,7 @@
 import CoreData
 import OSLog
 import SwiftUI
+import UserNotifications
 
 /// The app's main screen: reports by day, newest first, and the button that
 /// starts one.
@@ -34,7 +35,9 @@ struct HomeView: View {
         }
         .task {
             await describer.load(from: store)
-            await AppBadge.update(from: store)
+            // Earlier builds badged the icon with the number of instant
+            // reports; Reportage no longer badges, so clear what's left.
+            try? await UNUserNotificationCenter.current().setBadgeCount(0)
         }
         .onChange(of: inbox?.survey?.id, initial: true) { openPrompt() }
     }
@@ -43,7 +46,6 @@ struct HomeView: View {
         openPrompt()
         Task {
             await describer.load(from: store)
-            await AppBadge.update(from: store)
             await PromptScheduler().refresh()
         }
     }
@@ -65,7 +67,6 @@ struct HomeView: View {
             } catch {
                 logger.error("Couldn't file an instant report: \(error)")
             }
-            await AppBadge.update(from: store)
             await PromptScheduler().refresh()
         }
     }

diff --git a/Reportage/Views/Report/ReportDetailView.swift b/Reportage/Views/Report/ReportDetailView.swift

@@ -55,7 +55,6 @@ struct ReportDetailView: View {
         dismiss()
         Task {
             try? await store.delete(id: id)
-            await AppBadge.update(from: store)
         }
     }
 }

diff --git a/Reportage/Views/Settings/DataSection.swift b/Reportage/Views/Settings/DataSection.swift

@@ -168,7 +168,6 @@ struct DataSection: View {
             logger.error("Couldn't delete all data: \(error)")
             outcome = Outcome(title: "Couldn't Delete", message: error.localizedDescription)
         }
-        await AppBadge.update(from: store)
     }
 
     /// Removes the temporary copy once it's been saved or the save cancelled.

diff --git a/Reportage/Views/Settings/NotificationsView.swift b/Reportage/Views/Settings/NotificationsView.swift

@@ -5,7 +5,6 @@ import UserNotifications
 /// When random prompts come: how many, between which hours and how far
 /// apart.
 struct NotificationsView: View {
-    @Environment(\.reportStore) private var store
     @Environment(\.scenePhase) private var scenePhase
     @State private var settings = PromptSettings.load()
     @State private var notifications: UNAuthorizationStatus?
@@ -119,9 +118,8 @@ struct NotificationsView: View {
         }
     }
 
-    /// Turning prompts on asks for notifications (with the badge, which
-    /// counts instant reports) if they weren't allowed when the app was
-    /// first opened.
+    /// Turning prompts on asks for notifications if they weren't allowed
+    /// when the app was first opened.
     private var promptsEnabled: Binding<Bool> {
         Binding(
             get: { settings.isEnabled },
@@ -142,11 +140,10 @@ struct NotificationsView: View {
 
     private func turnOnPrompts() async {
         let center = UNUserNotificationCenter.current()
-        let granted = (try? await center.requestAuthorization(options: [.alert, .sound, .badge])) ?? false
+        let granted = (try? await center.requestAuthorization(options: [.alert, .sound])) ?? false
         await checkPermissions()
         guard granted else { return }
         settings.isEnabled = true
-        await AppBadge.update(from: store)
     }
 
     private func checkPermissions() async {

diff --git a/Reportage/Views/WelcomeView.swift b/Reportage/Views/WelcomeView.swift

@@ -4,7 +4,6 @@ import SwiftUI
 /// about to ask for location, notifications and Health. Continue asks for
 /// each in turn and closes once all are answered.
 struct WelcomeView: View {
-    @Environment(\.reportStore) private var store
     @State private var isAsking = false
     let onFinish: () -> Void
 
@@ -37,7 +36,7 @@ struct WelcomeView: View {
 
     private func askAndFinish() async {
         isAsking = true
-        await FirstLaunch.ask(store: store)
+        await FirstLaunch.ask()
         onFinish()
     }
 }