React-Native library which allows you to control device brightness
npm install @reeq/react-native-device-brightness
or
yarn add @reeq/react-native-device-brightness
and
cd ios/
pod install
import {
setBrightnessLevel,
getBrightnessLevel,
getSystemBrightnessLevel,
useDeviceBrightness,
useUnmountBrightness
} from '@reeq/react-native-device-brightness';
// setting brightness
setBrightnessLevel(level: number, animated?: boolean);
// getting brightness
const brightness = await getBrightnessLevel();
console.log(brightness);
// getting system brightness (Android only)
const brightness = await getSystemBrightnessLevel();
console.log(brightness);
// just setting a brightness for the rest of app's life
useDeviceBrightness(level: number, animated?: boolean);
// setting a brightness and will restore to previous brightness on unmount
useUnmountBrightness(level: number, animated?: boolean);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library