10000 fix(local-notifications): delete delivered notifications on iOS (#603) · NativeScript/plugins@92f2e5d · GitHub
[go: up one dir, main page]

Skip to content

Commit 92f2e5d

Browse files
authored
fix(local-notifications): delete delivered notifications on iOS (#603)
1 parent e847124 commit 92f2e5d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/local-notifications/index.ios.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ export class LocalNotificationsImpl extends LocalNotificationsCommon implements
370370
try {
371371
if (LocalNotificationsImpl.isUNUserNotificationCenterAvailable()) {
372372
UNUserNotificationCenter.currentNotificationCenter().removePendingNotificationRequestsWithIdentifiers(<any>['' + id]);
373+
UNUserNotificationCenter.currentNotificationCenter().removeDeliveredNotificationsWithIdentifiers(<any>['' + id]);
373374
resolve(true);
374375
} else {
375376
const scheduled = UIApplication.sharedApplication.scheduledLocalNotifications;
@@ -395,6 +396,7 @@ export class LocalNotificationsImpl extends LocalNotificationsCommon implements
395396
try {
396397
if (LocalNotificationsImpl.isUNUserNotificationCenterAvailable()) {
397398
UNUserNotificationCenter.currentNotificationCenter().removeAllPendingNotificationRequests();
399+
UNUserNotificationCenter.currentNotificationCenter().removeAllDeliveredNotifications();
398400
} else {
399401
UIApplication.sharedApplication.cancelAllLocalNotifications();
400402
}

0 commit comments

Comments
 (0)
0