mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 08:15:24 +00:00
65bab49f39
* Remove the CommonSettingsProtocol. * Replace multiple dependencies with the UserSession when it carries them.
26 lines
921 B
Swift
26 lines
921 B
Swift
//
|
|
// Copyright 2026 Element Creations Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import UserNotifications
|
|
|
|
nonisolated extension AppSettings {
|
|
/// The sound name to use in outgoing notifications.
|
|
/// Falls back to the default Element X tone if no custom tone has been selected.
|
|
var notificationSoundName: UNNotificationSoundName {
|
|
if selectedNotificationTone == nil {
|
|
return UNNotificationSoundName("message.caf")
|
|
} else {
|
|
return UNNotificationSoundName(NotificationToneManager.selectedToneFilename)
|
|
}
|
|
}
|
|
|
|
/// A `UNNotificationSound` built from `notificationSoundName`, ready to attach to a notification content object.
|
|
var notificationSound: UNNotificationSound {
|
|
UNNotificationSound(named: notificationSoundName)
|
|
}
|
|
}
|