react-native-proximity-dim-screen

A lib to turn off screen with proximity sensor.


Keywords
react-native, ios, android, react
License
MIT
Install
npm install react-native-proximity-dim-screen@0.1.1

Documentation

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

License

MIT