electron/shell/browser/notifications/mac
Developer-Ecosystem-Engineering d6fc627ba5
feat: replace deprecated NSUserNotifications with User Notifications (#47817)
* refactor: replace deprecated NSUserNotifications with User Notifications

Removes deprecated NSUserNotification API, now using User Notifications

It replaces API calls for generating, scheduling, and receiving native
macOS notifications with equivalent API calls from the new framework,
or functionally equivalent implementations.

To preserve the existing Notification module API, special handling was
required in certain cases:

  - Dynamically declared notification actions
    Typically, notification actions should be declared at app launch time
    when using the User Notifications framework. However, this isn’t
    compatible with Electron’s architecture. Instead, we dynamically
    declare new notifications actions when necessary and carefully manage
    the existing actions registered at runtime.

  - Localizations for ‘Reply’ and ‘Show’ labels
    New translation files are added and processed through GRIT to add
    localizations for “Reply” and “Show” button labels which were
    initially supplied by the NSUserNotification framework.

* Use NotificationImageRetainer pattern from //chrome

* build: fix lint

* build: update config to handle --translate-gender for pak files

* test: also sign on arm64

* fix: add error handling for scheduling notification

* docs: add details to breaking changes

* docs: clarify breaking change details

* docs: add details for notifications tutorial and API documentation

---------

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2026-03-05 11:57:19 -08:00
..
cocoa_notification.h feat: replace deprecated NSUserNotifications with User Notifications (#47817) 2026-03-05 11:57:19 -08:00
cocoa_notification.mm feat: replace deprecated NSUserNotifications with User Notifications (#47817) 2026-03-05 11:57:19 -08:00
notification_center_delegate.h feat: replace deprecated NSUserNotifications with User Notifications (#47817) 2026-03-05 11:57:19 -08:00
notification_center_delegate.mm feat: replace deprecated NSUserNotifications with User Notifications (#47817) 2026-03-05 11:57:19 -08:00
notification_presenter_mac.h feat: replace deprecated NSUserNotifications with User Notifications (#47817) 2026-03-05 11:57:19 -08:00
notification_presenter_mac.mm feat: replace deprecated NSUserNotifications with User Notifications (#47817) 2026-03-05 11:57:19 -08:00