-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
At the moment the method for cancelling all notifications involves also clearing notifications that have been pushed.
Current implementation for reference:
Lines 370 to 384 in 8839a00
| func cancelAll(_ result: @escaping FlutterResult) { | |
| if #available(macOS 10.14, *) { | |
| let center = UNUserNotificationCenter.current() | |
| center.removeAllPendingNotificationRequests() | |
| center.removeAllDeliveredNotifications() | |
| result(nil) | |
| } else { | |
| let center = NSUserNotificationCenter.default | |
| for scheduledNotification in center.scheduledNotifications { | |
| center.removeScheduledNotification(scheduledNotification) | |
| } | |
| center.removeAllDeliveredNotifications() | |
| result(nil) | |
| } | |
| } |
In order to avoid canceling pushed notifications one has to use a persistent solution to track notification IDs and delivery times in order to know which ids can be cancelled. It would be great if we could simply expose a function that exclusively calls removeAllPendingNotificationRequests.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels