Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>

This commit is contained in:
Matt Bruce 2025-09-08 15:52:11 -05:00
parent f4f365f4c7
commit 6322f1cbd3
13 changed files with 24 additions and 18 deletions

View File

@ -38,11 +38,12 @@ enum NotificationUtils {
if soundName == AppConstants.SystemSounds.defaultSound {
content.sound = UNNotificationSound.default
print("🔔 Using default notification sound")
} else {
// For alarm sounds, use the default notification sound since custom sounds need to be in the app bundle
// and properly configured. For now, use default to ensure notifications work.
content.sound = UNNotificationSound.default
print("🔔 Using default notification sound for alarm: \(soundName)")
// Use the sound name directly since sounds.json now references CAF files
content.sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: soundName))
print("🔔 Using custom alarm sound: \(soundName)")
print("🔔 Sound file should be in main bundle: \(soundName)")
}
return content

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -27,42 +27,42 @@
{
"id": "digital-alarm",
"name": "Digital Alarm",
"fileName": "digital-alarm.mp3",
"fileName": "digital-alarm.caf",
"category": "alarm",
"description": "Classic digital alarm sound",
"bundleName": "AlarmSounds"
"bundleName": null
},
{
"id": "iphone-alarm",
"name": "Buzzing Alarm",
"fileName": "buzzing-alarm.mp3",
"fileName": "buzzing-alarm.caf",
"category": "alarm",
"description": "Buzzing sound",
"bundleName": "AlarmSounds"
"bundleName": null
},
{
"id": "classic-alarm",
"name": "Classic Alarm",
"fileName": "classic-alarm.mp3",
"fileName": "classic-alarm.caf",
"category": "alarm",
"description": "Traditional alarm sound",
"bundleName": "AlarmSounds"
"bundleName": null
},
{
"id": "beep-alarm",
"name": "Beep Alarm",
"fileName": "beep-alarm.mp3",
"fileName": "beep-alarm.caf",
"category": "alarm",
"description": "Short beep alarm sound",
"bundleName": "AlarmSounds"
"bundleName": null
},
{
"id": "siren-alarm",
"name": "Siren Alarm",
"fileName": "siren-alarm.mp3",
"fileName": "siren-alarm.caf",
"category": "alarm",
"description": "Emergency siren alarm for heavy sleepers",
"bundleName": "AlarmSounds"
"bundleName": null
}
],
"categories": [

View File

@ -100,10 +100,15 @@ class FocusModeService {
let content = UNMutableNotificationContent()
content.title = title
content.body = body
// Use default notification sound for now to ensure notifications work
// Custom sounds require proper bundle configuration
content.sound = UNNotificationSound.default
print("🔔 Using default notification sound for alarm: \(soundName)")
// Use the sound name directly since sounds.json now references CAF files
if soundName == AppConstants.SystemSounds.defaultSound {
content.sound = UNNotificationSound.default
print("🔔 Using default notification sound")
} else {
content.sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: soundName))
print("🔔 Using custom alarm sound: \(soundName)")
print("🔔 Sound file should be in main bundle: \(soundName)")
}
content.categoryIdentifier = "ALARM_CATEGORY"
content.userInfo = [
"alarmId": identifier,