import { DeviceMotion, DeviceMotionAccelerationData } from '@awesome-cordova-plugins/device-motion/ngx';
constructor(private deviceMotion: DeviceMotion) { }
...
this.deviceMotion.getCurrentAcceleration().then(
(acceleration: DeviceMotionAccelerationData) => console.log(acceleration),
(error: any) => console.log(error)
);
var subscription = this.deviceMotion.watchAcceleration().subscribe((acceleration: DeviceMotionAccelerationData) => {
console.log(acceleration);
});
subscription.unsubscribe();