npm i @adrianso/react-native-device-brightness
//write code as following
import DeviceBrightness from 'react-native-device-brightness';
// Setting brightness
DeviceBrightness.setBrightnessLevel(brightness);
// Getting brightness
const brightness = await DeviceBrightness.getBrightnessLevel();
console.log(brightness);
// Getting system brightness (Android only)
const brightness = await DeviceBrightness.getSystemBrightnessLevel();
console.log(brightness);
// yarn add react-native-screen-brightness
import ScreenBrightness from 'react-native-screen-brightness';
ScreenBrightness.setBrightness(0.5); // between 0 and 1
ScreenBrightness.getBrightness().then(brightness => {
console.log('brightness', brightness);
});