Skip to content

Commit a977d8d

Browse files
committed
RU-T39 PR#184 fixes.
1 parent c301886 commit a977d8d

File tree

2 files changed

+8
-111
lines changed

2 files changed

+8
-111
lines changed

scripts/add-sounds-to-xcode.js

Lines changed: 0 additions & 109 deletions
This file was deleted.

src/services/push-notification.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,14 @@ class PushNotificationService {
133133
// Determine if this is a critical alert (calls)
134134
const isCritical = category === 'calls' || customType === '0';
135135

136+
// Extract sound name from FCM payload, fallback to 'default'
137+
const sound = (remoteMessage.data?.sound as string) || 'default';
138+
136139
await notifee.displayNotification({
137140
title: title,
138141
body: body,
139142
ios: {
140-
sound: 'default',
143+
sound: sound,
141144
criticalVolume: 1.0,
142145
critical: isCritical,
143146
categoryId: (category as string) || 'calls',
@@ -252,11 +255,14 @@ class PushNotificationService {
252255
const body = (remoteMessage.data?.message as string) || remoteMessage.notification.body;
253256
const isCritical = category === 'calls' || customType === '0';
254257

258+
// Derive sound from remoteMessage.data['sound'] or remoteMessage.notification?.ios?.sound, fallback to 'default'
259+
const soundName = String(remoteMessage.data?.sound || remoteMessage.notification?.ios?.sound || 'default');
260+
255261
await notifee.displayNotification({
256262
title: title,
257263
body: body,
258264
ios: {
259-
sound: 'default',
265+
sound: soundName,
260266
criticalVolume: 1.0,
261267
critical: isCritical,
262268
categoryId: (category as string) || 'calls',

0 commit comments

Comments
 (0)