Listen to changes in volume output
npm install @seventytwodays/react-native-volume-listener
import { useState, useEffect } from 'react';
import { addVolumeListener } from '@seventytwodays/react-native-volume-listener';
// ...
const [volume, setVolume] = useState(null);
useEffect(() => {
const listener = addVolumeListener((result) => {
setVolume(result.volume);
});
return () => listener.remove();
}, []);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library