Provides screen-on, proximity and brightness support
Install just like your ordinary react-native module.
Please check the example/ code.
import { Screen, ProximityScreenOffLock, ScreenOnLock } from 'react-native-mo-screen';
const lock = Screen.pushScreenOn();
// do something
lock.release();
const lock = Screen.pushProximityScreenOff();
// do something
lock.release();
Screen.setScreenBrightness(0.5);
return (
<View>
<ScreenOnLock />
<ProximityScreenOffLock />
</View>
)
- keep screen on only while in foreground?