File tree Expand file tree Collapse file tree 2 files changed +8
-111
lines changed
Expand file tree Collapse file tree 2 files changed +8
-111
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff 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' ,
You can’t perform that action at this time.
0 commit comments