This Cordova plugin gives access to X,Y,Z and total Magnitude readings from the device's internal magentometer. It is ideal for science toolkit or metal detector apps. The API can be accessed via single call or by placing a listener that fires a callback function repeatedly. For more information see https://github.com/sdesalas/cordova-plugin-magnetometer.
More information could be available on the GitHub README.

Installation is done via the Cordova CLI.

Install Cordova Magnetometer Plugin using the latest version from GitHub:

$ cordova plugin add https://github.com/sdesalas/cordova-plugin-magnetometer.git

Supported Platforms
  • Android
  • BlackBerry 10
  • Fire OS
  • Firefox OS
  • iOS
  • Ubuntu
  • Windows 8
  • Windows Phone 7
  • Windows Phone 8
Supported Engines
  • Unknown