UNPKG

cordova-plugin-pedometer

Version:

Cordova / PhoneGap Plugin for the Core Motion Pedometer to fetch pedestrian-related data, such as step counts and other information about the distance travelled.

33 lines (23 loc) 1.04 kB
var exec = require("cordova/exec"); var Pedometer = function () { this.name = "Pedometer"; }; Pedometer.prototype.isStepCountingAvailable = function (onSuccess, onError) { exec(onSuccess, onError, "Pedometer", "isStepCountingAvailable", []); }; Pedometer.prototype.isDistanceAvailable = function (onSuccess, onError) { exec(onSuccess, onError, "Pedometer", "isDistanceAvailable", []); }; Pedometer.prototype.isFloorCountingAvailable = function (onSuccess, onError) { exec(onSuccess, onError, "Pedometer", "isFloorCountingAvailable", []); }; Pedometer.prototype.startPedometerUpdates = function (onSuccess, onError) { exec(onSuccess, onError, "Pedometer", "startPedometerUpdates", []); }; Pedometer.prototype.stopPedometerUpdates = function (onSuccess, onError) { exec(onSuccess, onError, "Pedometer", "stopPedometerUpdates", []); }; Pedometer.prototype.queryData = function (onSuccess, onError, options) { exec(onSuccess, onError, "Pedometer", "queryData", [options]); }; module.exports = new Pedometer();