From 6fd11575af6d8806b7ea3ada6f35d1302e298098 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Mon, 8 Dec 2025 14:33:38 -0500 Subject: [PATCH] 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. --- RIT Dining.xcodeproj/project.pbxproj | 4 ++-- RIT Dining/Components/PushScheduler.swift | 1 + RIT Dining/Views/Visiting Chefs/VisitingChefsPush.swift | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RIT Dining.xcodeproj/project.pbxproj b/RIT Dining.xcodeproj/project.pbxproj index 8b045b6..5816f6c 100644 --- a/RIT Dining.xcodeproj/project.pbxproj +++ b/RIT Dining.xcodeproj/project.pbxproj @@ -265,7 +265,7 @@ CODE_SIGN_ENTITLEMENTS = "RIT Dining/RIT Dining.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEVELOPMENT_TEAM = 5GF7GKNTK4; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -300,7 +300,7 @@ CODE_SIGN_ENTITLEMENTS = "RIT Dining/RIT Dining.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 23; + CURRENT_PROJECT_VERSION = 24; DEVELOPMENT_TEAM = 5GF7GKNTK4; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; diff --git a/RIT Dining/Components/PushScheduler.swift b/RIT Dining/Components/PushScheduler.swift index 5eaccf8..e3ddb09 100644 --- a/RIT Dining/Components/PushScheduler.swift +++ b/RIT Dining/Components/PushScheduler.swift @@ -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. diff --git a/RIT Dining/Views/Visiting Chefs/VisitingChefsPush.swift b/RIT Dining/Views/Visiting Chefs/VisitingChefsPush.swift index 6be90bd..364f2ca 100644 --- a/RIT Dining/Views/Visiting Chefs/VisitingChefsPush.swift +++ b/RIT Dining/Views/Visiting Chefs/VisitingChefsPush.swift @@ -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) }