A JS/TS Library to programatically turn the screen off using the proximity sensor.
npm install react-native-proximity-screen
# For older RN versions
react-native link react-native-proximity-screen
import { startProximity, stopProximity } from 'react-native-proximity-screen';
import { useState, useEffect } from 'react';
// ...
useEffect(() => {
if (incall) {
startProximity();
} else {
stopProximity();
}
}, []);
See the contributing guide to learn how to contribute to the repository and the development workflow.
- Javier González for the android base.
MIT