npm react-native-volume-manager 2.0.5
Release 2.0.5

latest releases: 2.2.0, 2.0.8, 2.0.7...
23 months ago

[2.0.5](v2.0.4...v2.0.5) (2024-12-15)

Fixes (Android)

Turns out Android is, once again, a real PITA. The VolumeKeyListener was initially registered on the rootView, which somehow gets removed when you background the app and return. I changed the listener to the contentView, but this broke functionality when opening a modal. To address this, I updated the listener to attach to the correct view, which worked fine—until an input field was focused.

To handle this edge case, I added a tree observer to detect when an input is focused and when that focus is lost, allowing the listener to be restored by reassigning the appropriate window focus.

I believe this is now a reliable and functional solution. The tradeoff—volume button listeners not working when a dialog (alert) or input is focused—should be acceptable and not interfere with most app behaviors.

Don't miss a new react-native-volume-manager release

NewReleases is sending notifications on new releases.