Skip to content

Commit

Permalink
Play sound and vibrate; group by topic (omg Android, why can't you do…
Browse files Browse the repository at this point in the history
… that so easily!!!)
  • Loading branch information
binwiederhier committed May 24, 2022
1 parent 9060af5 commit cace472
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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">
</BreakpointContent>
Expand Down Expand Up @@ -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">
</BreakpointContent>
Expand Down
1 change: 0 additions & 1 deletion ntfy/App/AppMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions ntfyNSE/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cace472

Please sign in to comment.