How To Use The Pedometer Plugin?
i'm a working on a projet based on native application. I have to code a simple pedometer in cordova. I've downloaded the plugin in my file and i don't succed to get all the informa
Solution 1:
According to the docs:
Platform and device support
iOS 8+ only. These capabilities are not supported on all devices, even with iOS 8, so please ensure you use the check feature support functions.
So, you can test if the feature is supported with this code:
pedometer.isStepCountingAvailable(function(){
console.log( "Pedometer step counting is available" );
}, function(){
console.log( "Pedometer step counting is NOT available" );
});
and then you can do the same thing with pedometer.isDistanceAvailable()
and pedometer.isFloorCountingAvailable
Post a Comment for "How To Use The Pedometer Plugin?"