How to use the expo-sensors.Pedometer.isAvailableAsync function in expo-sensors

To help you get started, we’ve selected a few expo-sensors examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github byCedric / use-expo / packages / sensors / src / use-pedometer-history.ts View on Github external
useEffect(() => {
		if (availability) {
			Pedometer.isAvailableAsync().then(setAvailable);
		}

		Pedometer.getStepCountAsync(start, end).then(setData);
	}, []);
github byCedric / use-expo / packages / sensors / src / use-pedometer.ts View on Github external
useEffect(() => {
		if (availability) {
			Pedometer.isAvailableAsync().then(setAvailable);
		}

		return Pedometer.watchStepCount(setData).remove;
	}, []);
github expo / expo / apps / native-component-list / src / screens / PedometerScreen.tsx View on Github external
onPress={async () => {
            const result = await Pedometer.isAvailableAsync();
            Alert.alert('Pedometer result', `Is available: ${result}`);
          }}
          title="Is available"