Add sounds for visiting chef notifications

Oops, I missed that this had to be manually set up. Now requests the .sound permission and sets the default sound for notifications when scheduling them.
This commit is contained in:
2025-12-08 14:33:38 -05:00
parent 20f1b3df59
commit 6fd11575af
3 changed files with 4 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ func scheduleVisitingChefNotif(name: String, location: String, startTime: Date,
content.title = "\(name) Is On Campus Today"
}
content.body = "\(name) will be at \(location) from \(dateDisplay.string(from: startTime))-\(dateDisplay.string(from: endTime))"
content.sound = .default
// Get the time that we're going to schedule the notification for, which is a specified number of hours before the chef
// shows up. This is configurable from the notification settings.

View File

@@ -129,7 +129,7 @@ struct VisitingChefPush: View {
Task {
let center = UNUserNotificationCenter.current()
do {
try await center.requestAuthorization(options: [.alert])
try await center.requestAuthorization(options: [.alert, .sound])
} catch {
print(error)
}