feat: add id and groupId options to macOS notifications#50097
Merged
Conversation
b704de9 to
0f2700b
Compare
…ns with the same groupId will be visually grouped together in Notification Center
0f2700b to
01bf522
Compare
codebytere
reviewed
Mar 9, 2026
erickzhao
approved these changes
Mar 11, 2026
Comment on lines
+82
to
+83
| * `id` string (optional) _macOS_ - A unique identifier for the notification, mapping to `UNNotificationRequest`'s [`identifier`](https://developer.apple.com/documentation/usernotifications/unnotificationrequest/identifier) property. Defaults to a random UUID if not provided or if an empty string is passed. This can be used to remove or update previously delivered notifications. | ||
| * `groupId` string (optional) _macOS_ - A string identifier used to visually group notifications together in Notification Center. Maps to `UNNotificationContent`'s [`threadIdentifier`](https://developer.apple.com/documentation/usernotifications/unnotificationcontent/threadidentifier) property. |
Member
There was a problem hiding this comment.
Open to discussion on this, but this feels like it should go closer to the bottom of the API doc (assuming that people would care the most about title/body/icon for this API)
codebytere
approved these changes
Mar 16, 2026
|
Release Notes Persisted
|
Contributor
|
I have automatically backported this PR to "42-x-y", please check out #50304 |
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.
Description of Change
This PR is the first in a series of future PRs to expand the notifications API with new features on MacOS and Windows, now that we have access to Apple's UNNotification API.
This PR specifically adds a
idstring option to theNotificationconstructor on macOS, allowing users to assign a stable, custom identifier to notifications. It also adds agroupIdoption to theNotificationconstructor, mapping to theUNNotificationContent.threadIdentifierproperty on macOS. Notifications with the samegroupIdwill be visually grouped together in the Notification Center. When anidis not provided, the current behavior is unchanged.This behavior will be expanded to support additional operating systems in a future PR.
Checklist
npm testpassesRelease Notes
Notes: Added
idandgroupIdoptions to the Notification constructor on macOS.idallows custom identifiers for notifications, andgroupIdvisually groups notifications together in Notification Center.