An open API service indexing awesome lists of open source software.

https://github.com/douugdev/react-native-proximity-screen

An Android-only simple library to turn off screen on proximity.
https://github.com/douugdev/react-native-proximity-screen

android react react-native

Last synced: about 2 months ago
JSON representation

An Android-only simple library to turn off screen on proximity.

Awesome Lists containing this project

README

          

# react-native-proximity-screen

A JS/TS Library to programatically turn the screen off using the proximity sensor.

## Installation

```sh
npm install react-native-proximity-screen

# For older RN versions
react-native link react-native-proximity-screen
```

## Basic Usage

```js
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](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## Special Thanks

- [Javier González](https://github.com/CabezasGonzalezJavier) for the android base.

## License

MIT