wix / react-native-notifications

React Native Notifications
MIT License
3.23k stars 763 forks source link

Code that setting NotificationChannel sound on Android might lead unexpected consequences #1026

Open impodracer opened 8 months ago

impodracer commented 8 months ago

I'm using react-native-notifications to create notification channel on android. But some users using Android app complained about notification, something like "I can receive notifications but it doesn't sound". So I struggled to find out why but cannot find out what's going on there.

After some investigations, I found out that setSound() method in lib/android/app/src/main/java/com/wix/reactnativenotifications/core/notification/NotificationChannel.java passes null into soundAttribute parameter.

Screenshot 2024-01-13 at 5 16 20 PM

(compared below: same code in notifee/react-native is setting soundAttribute parameter)

Screenshot 2024-01-13 at 5 16 01 PM

I'm not good at android so I cannot pick exact cause and consequences, but there might be some differences, and reasons that some user complained about notification sounds.

impodracer commented 8 months ago

I know it's not good reference, but I asked Google Bard about this. -- Sorry, I was desparate :( https://g.co/bard/share/80b658b9e410