Clear notifications for fully read rooms using the event's timestamp instead of delivery date

This commit is contained in:
Stefan Ceriu
2026-10-06 15:40:24 +03:00
parent fc75f90ef5
commit 2182446684
8 changed files with 48 additions and 3 deletions
@@ -11,15 +11,16 @@ import UserNotifications
import XCTest
extension UNNotification {
static func with(userInfo: [AnyHashable: Any]) throws -> UNNotification {
static func with(userInfo: [AnyHashable: Any], identifier: String = "", date: Date = .now) throws -> UNNotification {
let content = UNMutableNotificationContent()
content.userInfo = userInfo
let request = UNNotificationRequest(identifier: "",
let request = UNNotificationRequest(identifier: identifier,
content: content,
trigger: nil)
let archiver = MockCoder(requiringSecureCoding: false)
let notification = try XCTUnwrap(UNNotification(coder: archiver))
notification.setValue(request, forKey: "request")
notification.setValue(date, forKey: "date")
return notification
}
}