feat: add Notification.getHistory() for macOS#51123
Merged
VerteDinde merged 7 commits intoApr 22, 2026
Merged
Conversation
Add `Notification.getHistory()` which returns a `Promise<Notification[]>` of all delivered notifications still present in Notification Center. Each returned Notification is a live object connected to the corresponding delivered notification — interaction events (click, reply, action, close) will fire on these objects, enabling apps to re-attach event handlers after a restart. Key implementation details: - Queries UNUserNotificationCenter's getDeliveredNotifications API - Creates live Notification objects with populated id, groupId, title, subtitle, and body properties from what macOS provides - Registers each object with the presenter via Restore() so the NotificationCenterDelegate routes events correctly - Restored notifications use is_restored_ flag to prevent removal from Notification Center when the JS object is garbage collected - Requires code-signed builds (unsigned builds resolve with empty array) Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Notifications returned by getHistory() now set is_restored_ so that Dismiss() skips removal from Notification Center on GC. Calling show() on a restored notification removes the original from NC and posts a new one. Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca> Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
6 tasks
VerteDinde
approved these changes
Apr 16, 2026
VerteDinde
approved these changes
Apr 22, 2026
Member
VerteDinde
left a comment
There was a problem hiding this comment.
Approved on behalf of @electron/wg-releases
|
Release Notes Persisted
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #50325
See that PR for details.
Notes: Added
Notification.getHistory()for macOS, allowing developers to restore all delivered notifications still present in Notification Center.