hirbod / react-native-volume-manager

React Native module which adds the ability to change the system volume on iOS and Android, listen to volume changes and supress the native volume UI to build your own volume slider or UX. It can listen to iOS mute switch and ringer mode changes on Android (and let you set the ringer mode)
MIT License
216 stars 13 forks source link

Android: isRingerListenerEnabled() is returning silent mode status, not the ringer listener status #24

Open harriha opened 5 months ago

harriha commented 5 months ago

Hi,

And thanks for the library, highly useful!

From the docs:

isRingerListenerEnabled(): Promise<boolean>: Asynchronously checks whether a ringer mode listener is enabled.

I might be misinterpreting things here, but I think there's some confusion here. This method seems to return whether the device is set to silent or not, but the docs and name suggest that this would tell whether a ringer listener is enabled or not. Also, to me, the "silent status" and "silent listener status" are a bit mixed up in the codebase. Does this observation make sense or is it just me getting confused for no good reason?

I've been having some struggle with the event listener handling, as e.g. the volume listener and ringer mode listener are working differently, but I guess there's a valid reason for the ringer mode listener to be setup differently than the others. Anyway, considering the current way of how the ringer mode listening is happening, having a way to check whether ringer mode listener is enabled would be useful.