Cordova iOS Pedometer

Hi guys,

I want to use the Pedometer cordova plugin for iOS 8+ => https://github.com/leecrossley/cordova-plugin-pedometer

But it is not loading from ngCordova.

My controller:

angular.module('starter.controllers', [])
.controller('PedometerCtrl', ['$scope', function ($scope) {
	var successHandler = function (pedometerData) {
		$scope.steps = pedometerData.numberOfSteps;
	    // pedometerData.distance;
	    // pedometerData.floorsAscended;
	    // pedometerData.floorsDescended;
	};
	var onError = function (error) {
		console.log("ERRO! " + error);
	}
	pedometer.startPedometerUpdates(successHandler, onError);
}]);

The plugin source:

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", []);
};

module.exports = new Pedometer();

Thanks!
-Vitor

isthe device ready function called before the plugin is called ?? make sure device ready is called… otherwise the plugins wnt work

Hey, is there any equivalent solution for android and older iOs devices? It could rely on Phonegap Accelerometer, but I guess it would reqiure some smart algorithm to maximize accuracy. Any ideas?