Skip to content

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

License

Notifications You must be signed in to change notification settings

douugdev/react-native-proximity-screen

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks