|
|
@@ -270,8 +270,6 @@ final class BaseUserNotificationsManager: NSObject, UserNotificationsManager, In
|
|
|
|
|
|
addAppBadge(glucose: (glucoseObjects.first?.glucose).map { Int($0) })
|
|
|
|
|
|
- guard settingsManager.settings.glucoseNotificationsOption != GlucoseNotificationsOption.disabled else { return }
|
|
|
-
|
|
|
var titles: [String] = []
|
|
|
var notificationAlarm = false
|
|
|
var messageType = MessageType.info
|
|
|
@@ -421,24 +419,22 @@ final class BaseUserNotificationsManager: NSObject, UserNotificationsManager, In
|
|
|
trigger: trigger,
|
|
|
action: action
|
|
|
)
|
|
|
- if alertPermissionsChecker.notificationsDisabled {
|
|
|
- router.alertMessage.send(messageCont)
|
|
|
- return
|
|
|
- }
|
|
|
- guard router.allowNotify(messageCont, settingsManager.settings) else { return }
|
|
|
-
|
|
|
var alertIdentifier = identifier.rawValue
|
|
|
alertIdentifier = identifier == .pumpNotification ? alertIdentifier + content
|
|
|
.title : (identifier == .alertMessageNotification ? alertIdentifier + content.body : alertIdentifier)
|
|
|
- let request = UNNotificationRequest(identifier: alertIdentifier, content: content, trigger: trigger)
|
|
|
-
|
|
|
if deleteOld {
|
|
|
DispatchQueue.main.async {
|
|
|
self.center.removeDeliveredNotifications(withIdentifiers: [alertIdentifier])
|
|
|
self.center.removePendingNotificationRequests(withIdentifiers: [alertIdentifier])
|
|
|
}
|
|
|
}
|
|
|
+ if alertPermissionsChecker.notificationsDisabled {
|
|
|
+ router.alertMessage.send(messageCont)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ guard router.allowNotify(messageCont, settingsManager.settings) else { return }
|
|
|
|
|
|
+ let request = UNNotificationRequest(identifier: alertIdentifier, content: content, trigger: trigger)
|
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
|
|
self.center.add(request) { error in
|
|
|
if let error = error {
|