rnative-sensor-manager
TypeScript icon, indicating that this package has built-in type declarations

0.9.6 • Public • Published

rnative-sensor-manager

This package is a wrapper for using sensor native modules

GitHub license open bugs npm npm downloads total npm downloads

Installation

npm install rnative-sensor-manager

Support

This project is under development, you can find the roadmap in github projects.

Platform Pressure Sensor Light Sensor Orientation Sensor Humidity Sensor Proximity Sensor Temperature Sensor Magnetic Sensor Step Sensor Gravity Sensor
Android
iOS

API Usage

Orientation

import SensorManager from "rnative-sensor-manager";
SensorManager.startOrientation(100);
DeviceEventEmitter.addListener("orientation", (data) => {
  /**
   * data.azimuth
   * data.pitch
   * data.roll
   **/
});
SensorManager.stopOrientation();

Light

import SensorManager from "rnative-sensor-manager";
SensorManager.startLight(100);
DeviceEventEmitter.addListener("light", (data) => {
  /**
   * data.lux
   **/
});
SensorManager.stopLight();

Thermometer

import SensorManager from "rnative-sensor-manager";
SensorManager.startThermometer(100);
DeviceEventEmitter.addListener("temperature", (data) => {
  /**
   * data.temperature
   **/
});
SensorManager.stopThermometer();

Proximity

import SensorManager from "rnative-sensor-manager";
SensorManager.startProximity(100);
DeviceEventEmitter.addListener("proximity", (data) => {
  /**
   * data.proximity
   **/
});
SensorManager.stopProximity();

Pressure

import SensorManager from "rnative-sensor-manager";
SensorManager.startPressure(100);
DeviceEventEmitter.addListener("pressure", (data) => {
  /**
   * data.pressure
   **/
});
SensorManager.stopPressure();

Humidity

import SensorManager from "rnative-sensor-manager";
SensorManager.startHumidity(100);
DeviceEventEmitter.addListener("humidity", (data) => {
  /**
   * data.humidity
   **/
});
SensorManager.stopHumidity();

Acknowledgements

License

MIT

Package Sidebar

Install

npm i rnative-sensor-manager

Weekly Downloads

1

Version

0.9.6

License

MIT

Unpacked Size

22.3 kB

Total Files

19

Last publish

Collaborators

  • j0nl1