cordova-plugin-sensors
cordova-plugin-sensors copied to clipboard
Cannot find name 'sensors'.
Hi, I tried the demo code for ionic 3 but i got "Cannot find name 'sensors " error.
This is my ionic info
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.9.2
System:
Node : v6.11.2
npm : 3.10.10
OS : Linux 4.8
and the error is
[23:34:29] typescript: src/pages/sensor/sensor.ts, line: 30
Cannot find name 'sensors'.
L29: console.log('get data')
L30: sensors.enableSensor("PROXIMITY")
L31: sensors.getState((values) => {
[23:34:29] typescript: src/pages/sensor/sensor.ts, line: 31
Cannot find name 'sensors'.
L30: sensors.enableSensor("PROXIMITY")
L31: sensors.getState((values) => {
L32: console.log(JSON.stringify(values))
Error: Failed to transpile program
at BuildError.Error (native)