🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

rnative-sensor-manager

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rnative-sensor-manager

A react-native wrapper that allows you to use android and iOS native sensors

latest
Source
npmnpm
Version
0.9.6
Version published
Weekly downloads
17
325%
Maintainers
1
Weekly downloads
 
Created
Source

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.

PlatformPressure SensorLight SensorOrientation SensorHumidity SensorProximity SensorTemperature SensorMagnetic SensorStep SensorGravity 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

  • react-native-sensor-manager has been a great source of inspiration for this project.

License

MIT

Keywords

rnative-sensor-manager

FAQs

Package last updated on 08 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts