react-native-oui-pedometer
v1.3.7
Published
A simple step counter
Downloads
10
Readme
react-native-oui-pedometer
Getting started
$ npm install react-native-oui-pedometer --save
$ react-native link react-native-oui-pedometer
Usage
import Pedometer from 'react-native-oui-pedometer'
Pedometer.isAvailable().then(isAvailable => {
// Whether the device has step counting capabilities.
})
Pedometer.authorizationStatus().then(authorizationStatus => {
// iOS only
//
// The authorization status as a string:
// - "not_determined"
// - "denied"
// - "authorized"
//
// Always "authorized" for Android.
})
Pedometer.requestAuthorization().then(() => {
// iOS only
//
// Request the user authorization to read the number of steps from Health Kit.
//
// Return directly on Android.
})
Pedometer.getNumberOfSteps().then(numberOfSteps => {
// Get the number of steps since a fixed moment in time.
})