react-native-pvt-screen-brightness

2.0.1 • Public • Published

react-native-pvt-screen-brightness

Access and update the system brightness on a device.

React Native compatibility

React Native version Compatible react-native-screen-brightness version
v0.60+ v2.x
v0.27 - v0.59 v1.x

Install

Install with yarn or npm.

yarn add react-native-screen-brightness
npm i --save react-native-screen-brightness

Example

For Android, you need to ask permission to change on system file

let hasPerm = await ScreenBrightness.hasPermission();
if(!hasPerm){
  ScreenBrightness.requestPermission();
  return;
}
import ScreenBrightness from 'react-native-screen-brightness';

ScreenBrightness.setBrightness(0.5); // between 0 and 1

ScreenBrightness.getBrightness().then(brightness => {
  console.log('brightness', brightness);
});

/react-native-pvt-screen-brightness/

    Package Sidebar

    Install

    npm i react-native-pvt-screen-brightness

    Weekly Downloads

    2

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    81.8 kB

    Total Files

    15

    Last publish

    Collaborators

    • privaterepo2021