After installing:
ionic plugin add cordova-plugin-device-motion
importing:
import {DeviceMotion} from 'ionic-native';
and running:
var subscription = DeviceMotion.watchAcceleration().subscribe(acceleration => { console.log(acceleration); });
I’m getting 2 errors:
plugin.js:129 TypeError: Cannot read property 'clearWatch' of undefined(…)
and
'cordova_not_available'
By the way I’m also using cordova-plugin-camera
and it works flawlessly.
Any ideas how to fix?