mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Custom sound support
This commit is contained in:
@@ -662,6 +662,7 @@ private final class NotificationServiceHandler {
|
||||
|> deliverOn(self.queue)).start(next: { [weak self] records, sharedData in
|
||||
var recordId: AccountRecordId?
|
||||
var isCurrentAccount: Bool = false
|
||||
var customSoundPath: String?
|
||||
|
||||
if let keyId = notificationPayloadKeyId(data: payloadData) {
|
||||
outer: for listRecord in records.records {
|
||||
@@ -681,6 +682,8 @@ private final class NotificationServiceHandler {
|
||||
|
||||
let inAppNotificationSettings = sharedData.entries[ApplicationSpecificSharedDataKeys.inAppNotificationSettings]?.get(InAppNotificationSettings.self) ?? InAppNotificationSettings.defaultSettings
|
||||
|
||||
customSoundPath = inAppNotificationSettings.customSound
|
||||
|
||||
let voiceCallSettings: VoiceCallSettings
|
||||
if let value = sharedData.entries[ApplicationSpecificSharedDataKeys.voiceCallSettings]?.get(VoiceCallSettings.self) {
|
||||
voiceCallSettings = value
|
||||
@@ -923,7 +926,11 @@ private final class NotificationServiceHandler {
|
||||
}
|
||||
|
||||
if let sound = aps["sound"] as? String {
|
||||
content.sound = sound
|
||||
if let customSoundPath = customSoundPath {
|
||||
content.sound = customSoundPath
|
||||
} else {
|
||||
content.sound = sound
|
||||
}
|
||||
}
|
||||
|
||||
if let category = aps["category"] as? String {
|
||||
|
||||
Reference in New Issue
Block a user