Releases: hirbod/react-native-volume-manager
Release 1.6.0
1.6.0 (2023-06-22)
Updates
In this release, significant changes were made to the getVolume
method to improve consistency in the API and to refine the data that is returned. Please read the notes below for more detailed information.
Breaking Changes
-
Reworked Types and Return of getVolume: The types and the return value of the
getVolume
method have been reworked. Previously, this method could return aVolumeResult
or anumber
. In order to maintain consistency, this method now only returns aVolumeResult
. This change is reflected in commit 9ab35ed. -
Changed getVolume Method: Along with the rework of types and return, changes have also been made to the
getVolume
method itself. Now,music
is the default result forresult.volume
when requesting the volume. Also, for Android, all other volume types are returned. This change can be found in commit a260e22. -
Please note that these changes may break existing implementations, so take care when updating.
-
Optimized all types and documentation
Features
- Reworked Example: The example code has been updated and refined to better reflect these changes. This can be viewed in commit 9e49fa1.
Please reach out if you have any questions or feedback regarding these updates!
Fixes #15
Release 1.5.1
Release 1.5.0
Release 1.4.0
Release 1.3.0
1.2.0
VolumeListener
- When you register a VolumeListener on iOS, it will now start the AudioSession with AVAudioSessionCategoryAmbient and MixWithOthers. This means, it does not stop running background music. If you want to disable background audio music, make sure to call setCategory and select a different category where background music is actually stopped.
Fixes
- AudioSession was not set after app was backgrounded and foregrounded, which caused the listener not to react anymore.
- Events won't be swallowed anymore, fixes #3
- New method
showNativeVolumeUI(config: { enabled: bool })
added (iOS and Android), it can also suppress hardware button presses (volume up/down) so you can build your own UI for it.
Big shoutout to @kirillzyusko for helping with the Android madness
v.1.1.0
VolumeListener
- When you register a VolumeListener on iOS, it will now start the AudioSession with AVAudioSessionCategoryAmbient and MixWithOthers. This means, it does not stop running background music. If you want to disable background audio music, make sure to call setCategory and select a different category where background music is actually stopped.
Fixes
- AudioSession was not set after app was backgrounded and foregrounded, which caused the listener not react anymore.
- Events won't be swallowed anymore
- New method
showNativeVolumeUI(config: { enabled: bool })
added (iOS only currently) to disable the volume toast globally.
Release 1.0.1
API changes
Breaking changes
useSilentSwitch
changes return type fromboolean
toRingMuteSwitchStatus
addSilentListener
changes parameter type from(status: boolean) => void
to(status: RingMuteSwitchEventCallback) => void
- type
eventCallback
is replaced byRingMuteSwitchEventCallback
New features
- introduced
type RingMuteSwitchStatus = { isMuted: boolean; initialQuery: boolean }
- introduced
type RingMuteSwitchStatusCallback = (status: RingMuteSwitchStatus) => void
Thanks @bbarthec for cleaning up and providing a good solution for the initial mute state!