diff --git a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift index 1b9b36996..3c516cea7 100644 --- a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift +++ b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift @@ -231,7 +231,9 @@ extension MessageReceiver { if let incomingMessage = messageToDelete as? TSIncomingMessage { incomingMessage.markAsReadNow(withSendReadReceipt: false, transaction: transaction) if let notificationIdentifier = incomingMessage.notificationIdentifier, !notificationIdentifier.isEmpty { - SSKEnvironment.shared.notificationsManager!.cancelNotification(notificationIdentifier) + UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [notificationIdentifier]) + UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [notificationIdentifier]) + } } if let serverHash = messageToDelete.serverHash {