Cordova Plugin Pedometers

2019-09-15 22:59发布

问题:

I try to put this plugin on my Android app https://github.com/leecrossley/cordova-plugin-pedometer

I put this on my OnDeviceReady :

var successHandler = function (pedometerData) {

alert(pedometerData.numberOfSteps);

};
pedometer.startPedometerUpdates(successHandler, onError);

I tried several code but it doesnt work,

Someone has a solution please

回答1:

check that plugin is properly installed with :

cordova plugin list

If you do not see it in the list, run:

cordova plugin add cordova-plugin-pedometer