Fix merge issue and check iOS availibility for notification priority
This commit is contained in:
parent
b0e0c8fc83
commit
0fde846aa1
2 changed files with 18 additions and 22 deletions
|
|
@ -150,15 +150,9 @@ struct NotificationListView: View {
|
|||
.padding(40)
|
||||
}
|
||||
})
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
.refreshable {
|
||||
subscriptionManager.poll(subscription)
|
||||
}
|
||||
.onAppear {
|
||||
cancelSubscriptionNotifications()
|
||||
}
|
||||
>>>>>>> 6d40c441f96e3a6c7331e3883bdf5df999ce8d66
|
||||
}
|
||||
|
||||
private var editButton: some View {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue