Skip to content

feat: add remove, removeAll, and removeGroup for notifications API - #51182

Merged
jkleinsc merged 2 commits into
mainfrom
feat/notification-remove-methods
May 18, 2026
Merged

jkleinsc merged 2 commits into
mainfrom
feat/notification-remove-methods

Conversation

@VerteDinde

@VerteDinde VerteDinde commented Apr 20, 2026 •

Copy link
Copy Markdown
Member

Description of Change

This PR adds Notification.remove(), removeAll(), removeGroup() static methods for macOS.

Add static methods for removing delivered notifications from Notification Center via the UNUserNotificationCenter API:

  • remove(id) removes one or more notifications by identifier (accepts string or string array)
  • removeAll() removes all of the app's delivered notifications
  • removeGroup(groupId) removes all notifications with a given groupId

These methods build on the custom id/groupId support and getHistory() to enable full notification lifecycle management from the main process.

Checklist

Release Notes

Notes: Added Notification.remove(), removeAll(), and removeGroup() static methods for macOS.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Apr 20, 2026
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Apr 27, 2026
VerteDinde and others added 2 commits April 27, 2026 12:30
…tic methods (macOS)

Add static methods for removing delivered notifications from Notification
Center via the UNUserNotificationCenter API:

- `remove(id)` removes one or more notifications by identifier (accepts
  string or string array)
- `removeAll()` removes all of the app's delivered notifications
- `removeGroup(groupId)` removes all notifications with a given groupId

These methods build on the custom id/groupId support and getHistory() to
enable full notification lifecycle management from the main process.

Co-Authored-By: Claude <[email protected]>
@VerteDinde
VerteDinde force-pushed the feat/notification-remove-methods branch from ea58ddb to f9cdfeb Compare April 27, 2026 19:50
@VerteDinde
VerteDinde marked this pull request as ready for review May 13, 2026 21:11
@VerteDinde VerteDinde added target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. semver/minor backwards-compatible functionality labels May 13, 2026

@reitowo reitowo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@jkleinsc jkleinsc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@itsananderson itsananderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

Release notes mention mac and windows, but he docs/implementation seem to be Mac only. I'm guessing there will be a follow-up PR to add Windows support, but we should make sure the release notes match the implementation.

@jkleinsc jkleinsc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@jkleinsc jkleinsc removed the new-pr 🌱 PR opened recently label May 18, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label May 18, 2026
@jkleinsc

Copy link
Copy Markdown
Member

Not sure why cation is fighting this one. I'm merging as it has the needed API reviews.

@jkleinsc
jkleinsc merged commit dcb4bef into main May 18, 2026
96 of 97 checks passed
@release-clerk

release-clerk Bot commented May 18, 2026

Copy link
Copy Markdown

Release Notes Persisted

Added Notification.remove(), removeAll(), and removeGroup() static methods for macOS.

@trop

trop Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #51690

@trop trop Bot added in-flight/43-x-y and removed target/43-x-y PR should also be added to the "43-x-y" branch. labels May 18, 2026
@trop

trop Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #51691

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

44-x-y api-review/requested 🗳 merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. new-pr 🌱 PR opened recently semver/minor backwards-compatible functionality

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants