zo0r / react-native-push-notification

React Native Local and Remote Notifications
MIT License
6.75k stars 2.05k forks source link

Not playing Alarm Sound when mobile is on Silent Mode #2350

Closed musawarbilal786 closed 6 months ago

musawarbilal786 commented 1 year ago

Question

So I'm trying to implement a custom alarm app that could schedule alarm and then run a push notification with custom sound on a scheduled time.

I am using React-Native-Push-Notification for my Alarm APP, everything is working fine but in silent mode, it does not play Alarm sound.

I'm scheduling Alarm by using PushNotification.localNotificationSchedule()

Here is code of localNotificationSchedule:

PushNotification.localNotificationSchedule({ channelId: "alarm-channel", title: alarmNotifData.title, id: alarmNotifData.id, message: alarmNotifData.message, date: alarmNotifData.fire_date, actions: ["Snooze", "Stop Alarm"], importance: Importance.HIGH, playSound: true, soundName: "default", allowWhileIdle: true, invokeApp: false, });

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.