Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react native controlling device brightness

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);
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #react #native #controlling #device #brightness
ADD COMMENT
Topic
Name
3+6 =