Sensors

Contents

This plugin enables sensors on Android devices

https://github.com/fabiorogeriosj/cordova-plugin-sensors.git

Ionic Sensors插件的安装(Installation)

ionic cordova plugin add https://github.com/fabiorogeriosj/cordova-plugin-sensors.git npm install @ionic-native/sensors

Ionic Sensors插件支持的平台(Supported Platforms)

  • Android

Ionic Sensors插件的用法(Usage)

import { Sensors, TYPE_SENSOR } from '@ionic-native/sensors';


constructor(private sensors: Sensors) { }

...


this.sensors.enableSensor(TYPE_SENSOR.LIGHT);