handle canceling push notification

pull/484/head
ryanzhao 4 years ago
parent 5f2890a1fc
commit 940e09c25b

@ -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 {

Loading…
Cancel
Save