From 8b6833edd917ffc5383758ef606c0cca2aba7cd8 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Tue, 16 Sep 2025 17:04:02 -0700 Subject: [PATCH] Request authorization from UNUserNotificationCenter to display app icon badges. Addresses #1255 --- .../Managed Software Center/AppDelegate.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/apps/Managed Software Center/Managed Software Center/AppDelegate.swift b/code/apps/Managed Software Center/Managed Software Center/AppDelegate.swift index 92043633..ffa3deb8 100644 --- a/code/apps/Managed Software Center/Managed Software Center/AppDelegate.swift +++ b/code/apps/Managed Software Center/Managed Software Center/AppDelegate.swift @@ -81,6 +81,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele // have the statuscontroller register for its own notifications statusController.registerForNotifications() + // we need to let UNUserNotificationCenter know we + // support Dock icon badges + let center = UNUserNotificationCenter.current() + center.requestAuthorization(options: [.badge], completionHandler: { _, _ in return }) + // user may have launched the app manually, or it may have // been launched by /usr/local/munki/managedsoftwareupdate // to display available updates, or via a munki: URL