$cordovaDeviceMotion .getCurrentAcceleration() .then(function (motion) { // success, use motion }, function (err) { // error });
var options = { frequency: 3000 }; var watch = $cordovaDeviceMotion.watchAcceleration(options); watch.promise.then( function () { /* unused */ }, function (err) { // error }, function (motion) { // motion with constant updates });
// use watch.watchID from watchAccelaration() $cordovaDeviceMotion .clearWatch(watch.watchID) .then(function (result) { // success }, function (err) { // error });