Search docs/
Getting StartedPlugins

Device Motion

Requires Cordova plugin: cordova-plugin-device-motion. For more info, please see the Device Motion docs.

Stuck on a Cordova issue?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.

Contact Us Today!


npm install cordova-plugin-device-motionnpm install @ionic-native/device-motionionic cap syncionic cordova plugin add cordova-plugin-device-motionnpm install @ionic-native/device-motion
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Learn More or if you're interested in an enterprise version of this plugin Contact Us

Supported Platforms

  • Android
  • BlackBerry 10
  • Browser
  • Firefox OS
  • iOS
  • Tizen
  • Ubuntu
  • Windows
  • Windows Phone 8



See here.


import { DeviceMotion, DeviceMotionAccelerationData } from '@ionic-native/device-motion/ngx';

constructor(private deviceMotion: DeviceMotion) { }


// Get the device current acceleration
  (acceleration: DeviceMotionAccelerationData) => console.log(acceleration),
  (error: any) => console.log(error)

// Watch device acceleration
var subscription = this.deviceMotion.watchAcceleration().subscribe((acceleration: DeviceMotionAccelerationData) => {

// Stop watch