JSPM

rnative-sensor-manager

0.9.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q39489F

A react-native module that allows you to use the accelerometer, gyroscope and magnetometer and Android devices

Package Exports

  • rnative-sensor-manager

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rnative-sensor-manager) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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

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();

Acknowledgements

License

MIT