@@ -254,35 +254,39 @@ class NotificationsService {
254254 data ?: unknown ;
255255 id ?: string ;
256256 } ) : Promise < void > => {
257- await notifee . displayNotification ( {
258- id,
259- title,
260- body,
261- // Notifee can only store and handle data strings
262- data : { dataStr : JSON . stringify ( data ) } ,
263- android : {
264- smallIcon : 'ic_notification_small' ,
265- largeIcon : 'ic_notification' ,
266- channelId : channelId ?? ChannelId . DEFAULT_NOTIFICATION_CHANNEL_ID ,
267- pressAction : {
268- id : pressActionId ,
269- launchActivity : LAUNCH_ACTIVITY ,
257+ try {
258+ await notifee . displayNotification ( {
259+ id,
260+ title,
261+ body,
262+ // Notifee can only store and handle data strings
263+ data : { dataStr : JSON . stringify ( data ) } ,
264+ android : {
265+ smallIcon : 'ic_notification_small' ,
266+ largeIcon : 'ic_notification' ,
267+ channelId : channelId ?? ChannelId . DEFAULT_NOTIFICATION_CHANNEL_ID ,
268+ pressAction : {
269+ id : pressActionId ,
270+ launchActivity : LAUNCH_ACTIVITY ,
271+ } ,
272+ tag : id ,
270273 } ,
271- tag : id ,
272- } ,
273- ios : {
274- launchImageName : 'Default' ,
275- sound : 'default' ,
276- interruptionLevel : 'critical' ,
277- foregroundPresentationOptions : {
278- alert : true ,
279- sound : true ,
280- badge : true ,
281- banner : true ,
282- list : true ,
274+ ios : {
275+ launchImageName : 'Default' ,
276+ sound : 'default' ,
277+ interruptionLevel : 'critical' ,
278+ foregroundPresentationOptions : {
279+ alert : true ,
280+ sound : true ,
281+ badge : true ,
282+ banner : true ,
283+ list : true ,
284+ } ,
283285 } ,
284- } ,
285- } ) ;
286+ } ) ;
287+ } catch ( error ) {
288+ Logger . log ( 'Error displaying notification ' , error ) ;
289+ }
286290 } ;
287291}
288292
0 commit comments