Removing Delivered Notifications (#1305)

* completed

* changelog

* tests

* more tests

* better naming

* fix

* a bit more waiting time

* generated mocks

* xcodegen
This commit is contained in:
Mauro
2023-07-11 10:44:06 +02:00
committed by GitHub
parent 98dabe8500
commit 28fa1140b7
15 changed files with 245 additions and 8 deletions
@@ -17,10 +17,14 @@
import Foundation
import UserNotifications
// Sadly we can't mock this because the delegate needs to be weak
// Use UserNotificationCenterSpy
protocol UserNotificationCenterProtocol: AnyObject {
var delegate: UNUserNotificationCenterDelegate? { get set }
func add(_ request: UNNotificationRequest) async throws
func requestAuthorization(options: UNAuthorizationOptions) async throws -> Bool
func deliveredNotifications() async -> [UNNotification]
func removeDeliveredNotifications(withIdentifiers identifiers: [String])
func setNotificationCategories(_ categories: Set<UNNotificationCategory>)
func authorizationStatus() async -> UNAuthorizationStatus
}