mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 03:20:50 +02:00
Update NotificationSettingsServiceType
This commit is contained in:
+5
-2
@@ -70,12 +70,15 @@ class MXNotificationSettingsService: NotificationSettingsServiceType {
|
||||
session.notificationCenter.removeRule(rule)
|
||||
}
|
||||
|
||||
func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?) {
|
||||
func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?, completion: ((Result<Void, Error>) -> Void)?) {
|
||||
guard let rule = session.notificationCenter.rule(byId: ruleId) else {
|
||||
return
|
||||
}
|
||||
|
||||
session.notificationCenter.enableRule(rule, isEnabled: enabled)
|
||||
session.notificationCenter.enableRule(rule, isEnabled: enabled) { error in
|
||||
#warning("complete here")
|
||||
print("*** enable error: \(error)")
|
||||
}
|
||||
|
||||
if let actions = actions {
|
||||
session.notificationCenter.updatePushRuleActions(ruleId,
|
||||
|
||||
+2
-1
@@ -44,5 +44,6 @@ class MockNotificationSettingsService: NotificationSettingsServiceType, Observab
|
||||
keywords.remove(keyword)
|
||||
}
|
||||
|
||||
func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?) { }
|
||||
func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?, completion: ((Result<Void, Error>) -> Void)?) {
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -40,5 +40,6 @@ protocol NotificationSettingsServiceType {
|
||||
/// - ruleId: The id of the rule.
|
||||
/// - enabled: Whether the rule should be enabled or disabled.
|
||||
/// - actions: The actions to update with.
|
||||
func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?)
|
||||
/// - completion: The completion of the operation.
|
||||
func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?, completion: ((Result<Void, Error>) -> Void)?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user