diff --git a/ntfy/Views/NotificationListView.swift b/ntfy/Views/NotificationListView.swift index 5a02c1a..919f40d 100644 --- a/ntfy/Views/NotificationListView.swift +++ b/ntfy/Views/NotificationListView.swift @@ -150,15 +150,9 @@ struct NotificationListView: View { .padding(40) } }) -<<<<<<< HEAD -======= - .refreshable { - subscriptionManager.poll(subscription) - } .onAppear { cancelSubscriptionNotifications() } ->>>>>>> 6d40c441f96e3a6c7331e3883bdf5df999ce8d66 } private var editButton: some View { diff --git a/ntfyNSE/NotificationService.swift b/ntfyNSE/NotificationService.swift index 554a731..a7b3819 100644 --- a/ntfyNSE/NotificationService.swift +++ b/ntfyNSE/NotificationService.swift @@ -48,22 +48,24 @@ class NotificationService: UNNotificationServiceExtension { bestAttemptContent.threadIdentifier = topic // Map priorities to interruption level (light up screen, ...) and relevance (order) - switch priority { - case "1": - bestAttemptContent.interruptionLevel = .passive - bestAttemptContent.relevanceScore = 0 - case "2": - bestAttemptContent.interruptionLevel = .passive - bestAttemptContent.relevanceScore = 0.25 - case "4": - bestAttemptContent.interruptionLevel = .timeSensitive - bestAttemptContent.relevanceScore = 0.75 - case "5": - bestAttemptContent.interruptionLevel = .critical - bestAttemptContent.relevanceScore = 1 - default: - bestAttemptContent.interruptionLevel = .active - bestAttemptContent.relevanceScore = 0.5 + if #available(iOS 15.0, *) { + switch priority { + case "1": + bestAttemptContent.interruptionLevel = .passive + bestAttemptContent.relevanceScore = 0 + case "2": + bestAttemptContent.interruptionLevel = .passive + bestAttemptContent.relevanceScore = 0.25 + case "4": + bestAttemptContent.interruptionLevel = .timeSensitive + bestAttemptContent.relevanceScore = 0.75 + case "5": + bestAttemptContent.interruptionLevel = .critical + bestAttemptContent.relevanceScore = 1 + default: + bestAttemptContent.interruptionLevel = .active + bestAttemptContent.relevanceScore = 0.5 + } } // Save notification to store, and display it