Releases: hirbod/react-native-volume-manager
Release 2.0.7
2.0.7 (2024-12-15)
Features
- Added web platform support via no-op implementations
- All methods now have web-safe fallbacks that return appropriate default values or undefined or null
- Added development-mode warning when methods are called on web platform
Release 2.0.6
2.0.6 (2024-12-15)
Changelog
💥 Breaking Changes
- Renamed
isRingerListenerEnabled
toisAndroidDeviceSilent
to better reflect its functionality
Asynchronously checks if the device is in a silent state on Android (including silent mode, vibrate mode, or muted volume / do not disturb mode).
- iOS returns null
Migration Guide
If you were previously using isRingerListenerEnabled()
, you'll need to:
- Update the function name to
isAndroidDeviceSilent()
- Add iOS platform check if used in cross-platform code
Release 2.0.5
[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.
Release 2.0.4
2.0.4 (2024-12-15)
Bugfixes
- Fixed a crash on Android caused by a race condition by moving checks to the same thread.
- Correctly restored toast volume suppression on Android when the app returns to the foreground after being backgrounded.
Release 2.0.3
2.0.3 (2024-12-15)
- Silence unused param warning in Kotlin file, since we need it
Release 2.0.2
2.0.2 (2024-12-15)
Bugfixes
- Fixed an issue on Android, where
VolumeManager.enable()
requires a second parameter - Added namespace to build.gradle
Release 2.0.1
2.0.1 (2024-12-15)
New
- Added support for the new architecture (thanks @hrastnik).
Breaking Changes
- Requires React Native 0.76+.
- Minimum supported iOS version is now 15+.
- Volume Listener (Android): Only reports the changed volume type and includes the type in the callback.
Bug Fixes
Android
- Fixed RingerMode listener triggering on volume change.
- Resolved Null Pointer Exception when setting up key listeners.
- Volume listener now reports only the changed volume type instead of sending events for all volumes (previously 7 events).
- Properly set up and remove listeners.
iOS
- Removed deprecated code.
- Refactored how native toast is set up and suppressed.
- Improved detection of the top-most view.
- Removed an incorrectly exported method that caused crashes with the new architecture.
Full Changelog: v1.10.0...v2.0.1
Release 1.10.0
Release 1.8.1
1.8.1 (2023-06-23)
Better API docs