diff --git a/ntfy.xcodeproj/xcuserdata/pheckel.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ntfy.xcodeproj/xcuserdata/pheckel.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index c4c5342..41edd36 100644 --- a/ntfy.xcodeproj/xcuserdata/pheckel.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/ntfy.xcodeproj/xcuserdata/pheckel.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -30,8 +30,8 @@ filePath = "ntfyNSE/NotificationService.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "34" - endingLineNumber = "34" + startingLineNumber = "38" + endingLineNumber = "38" landmarkName = "didReceive(_:withContentHandler:)" landmarkType = "7"> @@ -78,8 +78,8 @@ filePath = "ntfyNSE/NotificationService.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "33" - endingLineNumber = "33" + startingLineNumber = "37" + endingLineNumber = "37" landmarkName = "didReceive(_:withContentHandler:)" landmarkType = "7"> diff --git a/ntfy/App/AppMain.swift b/ntfy/App/AppMain.swift index 5644356..20f7139 100644 --- a/ntfy/App/AppMain.swift +++ b/ntfy/App/AppMain.swift @@ -5,7 +5,6 @@ import Firebase // TODO: Verify whether model version needs to be specified // TODO: Disallow adding same topic twice!! // TODO: When clicked, the notification does not open the topic, but instead just shows the last view -// TODO: The notification does not make a sound or vibrate on the Apple Watch // TODO: When opening a topic, the notifications in the Apple notification center should be dismissed automatically // TODO: Errors are not shown to the user, but instead just logged diff --git a/ntfyNSE/NotificationService.swift b/ntfyNSE/NotificationService.swift index 784afb1..41e6596 100644 --- a/ntfyNSE/NotificationService.swift +++ b/ntfyNSE/NotificationService.swift @@ -30,6 +30,10 @@ class NotificationService: UNNotificationServiceExtension { } } + // Play a sound, and group by topic + bestAttemptContent.sound = .default + bestAttemptContent.threadIdentifier = userInfo["topic"] as? String ?? "" + // Save notification to store, and display it Store.shared.save(notificationFromUserInfo: userInfo) contentHandler(bestAttemptContent)