Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
f4f365f4c7
commit
6322f1cbd3
@ -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.
BIN
TheNoiseClock/Resources/AlarmSounds/beep-alarm.caf
Normal file
BIN
TheNoiseClock/Resources/AlarmSounds/beep-alarm.caf
Normal file
Binary file not shown.
BIN
TheNoiseClock/Resources/AlarmSounds/buzzing-alarm.caf
Normal file
BIN
TheNoiseClock/Resources/AlarmSounds/buzzing-alarm.caf
Normal file
Binary file not shown.
BIN
TheNoiseClock/Resources/AlarmSounds/classic-alarm.caf
Normal file
BIN
TheNoiseClock/Resources/AlarmSounds/classic-alarm.caf
Normal file
Binary file not shown.
BIN
TheNoiseClock/Resources/AlarmSounds/digital-alarm.caf
Normal file
BIN
TheNoiseClock/Resources/AlarmSounds/digital-alarm.caf
Normal file
Binary file not shown.
BIN
TheNoiseClock/Resources/AlarmSounds/siren-alarm.caf
Normal file
BIN
TheNoiseClock/Resources/AlarmSounds/siren-alarm.caf
Normal file
Binary file not shown.
@ -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": [
|
||||
|
||||
@ -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
|
||||
// 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 for alarm: \(soundName)")
|
||||
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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user