Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 1.09 KB

README.md

File metadata and controls

55 lines (42 loc) · 1.09 KB

cordova-plugin-motion-activity

A Cordova plugin that detects and watch motion API.

Installation

  
    cordova plugin add https://github.com/mrameezraja/cordova-plugin-motion-activity
  

Methods

  • cordova.plugins.motionActivity.requestUpdates
  • cordova.plugins.motionActivity.stop

cordova.plugins.motionActivity.requestUpdates


  window.cordova.plugins.motionActivity.requestUpdates(function success(readings) {
    console.log(JSON.stringify(readings));
    // sample output
    // { 'confidence': 2, 'unknown'; 0, 'stationary': 1, 'walking': 0, 'running': 0, 'cycling': 0, 'automotive': 0 }
  }, function(error){
    console.log(error);
  })

cordova.plugins.motionActivity.stop


  window.cordova.plugins.motionActivity.stop(function success() {
    console.log('motion detection stopped');
  }, function(error){
    console.log(error);
  })

Supported Platforms

  • IOS
  • Android (In Progress)