Flutter教程

Sensors

Contents

This plugin enables sensors on Android devices

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

联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.

Contact Us Today!

Ionic Sensors插件的安装(Installation)

ionic cordova plugin add https://github.com/fabiorogeriosj/cordova-plugin-sensors.git npm install @ionic-native/sensors
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/sensors

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

  • Android

Ionic Sensors插件的用法(Usage)

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


constructor(private sensors: Sensors) { }

...


this.sensors.enableSensor(TYPE_SENSOR.LIGHT);