Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 1022 Bytes

README.md

File metadata and controls

56 lines (41 loc) · 1022 Bytes

cordova-plugin-magnetometer

A magnetic field detector plugin. It displays the raw x, y, and z magnetometer values and a computed magnitude of the magnetic field.

Installation

cordova plugin add https://github.com/mrameezraja/cordova-plugin-magnetometer

Methods

  • cordova.plugins.magnetoMeter.watchMagnitude
  • cordova.plugins.magnetoMeter.stop

cordova.plugins.magnetoMeter.watchMagnitude


  cordova.plugins.magnetoMeter.watchMagnitude(function(readings){
    console.log(JSON.stringify(readings));
  }, function(error){
    console.log(error);
  })

Readings:

  • magnitude
  • x
  • y
  • z

cordova.plugins.magnetoMeter.stop


  cordova.plugins.magnetoMeter.stop(function(result){
      console.log(result);
  }, function(error){
    console.log(error);
  })

Supported Platforms

  • IOS
  • Android (In Progress)