mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:31:27 +00:00
Replace completion handlers with async/await. (#407)
This commit is contained in:
@@ -21,16 +21,15 @@ class UserNotificationCenterSpy: UserNotificationCenterProtocol {
|
||||
weak var delegate: UNUserNotificationCenterDelegate?
|
||||
|
||||
var addRequest: UNNotificationRequest?
|
||||
func add(_ request: UNNotificationRequest, withCompletionHandler completionHandler: ((Error?) -> Void)?) {
|
||||
func add(_ request: UNNotificationRequest) async throws {
|
||||
addRequest = request
|
||||
completionHandler?(nil)
|
||||
}
|
||||
|
||||
var requestAuthorizationOptions: UNAuthorizationOptions?
|
||||
var requestAuthorizationGrantedReturnValue = false
|
||||
func requestAuthorization(options: UNAuthorizationOptions, completionHandler: @escaping (Bool, Error?) -> Void) {
|
||||
func requestAuthorization(options: UNAuthorizationOptions) async throws -> Bool {
|
||||
requestAuthorizationOptions = options
|
||||
completionHandler(requestAuthorizationGrantedReturnValue, nil)
|
||||
return requestAuthorizationGrantedReturnValue
|
||||
}
|
||||
|
||||
var notificationCategoriesValue: Set<UNNotificationCategory>?
|
||||
|
||||
Reference in New Issue
Block a user