react-native-proximity-screen-shim
v0.1.6
Published
A lib to turn off screen with proximity sensor.
Downloads
5
Readme
react-native-proximity-screen
A JS/TS Library to programatically turn the screen off using the proximity sensor.
Installation
npm install react-native-proximity-screen
# For older RN versions
react-native link react-native-proximity-screen
Basic Usage
import { startProximity, stopProximity } from 'react-native-proximity-screen';
import { useState, useEffect } from 'react';
// ...
useEffect(() => {
if (incall) {
startProximity();
} else {
stopProximity();
}
}, []);
Docs
async startProximity(void)
async stopProximity(void)
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
Special Thanks
- Javier González for the android base.
License
MIT