Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
useEffect(() => {
if (availability) {
Pedometer.isAvailableAsync().then(setAvailable);
}
Pedometer.getStepCountAsync(start, end).then(setData);
}, []);
useEffect(() => {
if (availability) {
Pedometer.isAvailableAsync().then(setAvailable);
}
return Pedometer.watchStepCount(setData).remove;
}, []);
onPress={async () => {
const result = await Pedometer.isAvailableAsync();
Alert.alert('Pedometer result', `Is available: ${result}`);
}}
title="Is available"