diff --git a/Signal/src/UserInterface/Notifications/LegacyNotificationsAdaptee.swift b/Signal/src/UserInterface/Notifications/LegacyNotificationsAdaptee.swift index cc326e3b3..f44aac478 100644 --- a/Signal/src/UserInterface/Notifications/LegacyNotificationsAdaptee.swift +++ b/Signal/src/UserInterface/Notifications/LegacyNotificationsAdaptee.swift @@ -222,6 +222,10 @@ extension LegacyNotificationPresenterAdaptee: NotificationPresenterAdaptee { for (_, notification) in notifications { cancelNotification(notification) } + type(of: self).clearExistingNotifications() + } + + public class func clearExistingNotifications() { // This will cancel all "scheduled" local notifications that haven't // been presented yet. UIApplication.shared.cancelAllLocalNotifications() diff --git a/Signal/src/UserInterface/Notifications/UserNotificationsAdaptee.swift b/Signal/src/UserInterface/Notifications/UserNotificationsAdaptee.swift index 6b037c8aa..412ed633c 100644 --- a/Signal/src/UserInterface/Notifications/UserNotificationsAdaptee.swift +++ b/Signal/src/UserInterface/Notifications/UserNotificationsAdaptee.swift @@ -181,6 +181,7 @@ extension UserNotificationPresenterAdaptee: NotificationPresenterAdaptee { AssertIsOnMainThread() notificationCenter.removeAllPendingNotificationRequests() notificationCenter.removeAllDeliveredNotifications() + LegacyNotificationPresenterAdaptee.clearExistingNotifications() } func shouldPresentNotification(category: AppNotificationCategory, userInfo: [AnyHashable: Any]) -> Bool {