How to use the expo-sensors.Pedometer.watchStepCount 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.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 () => {
            this.listener = Pedometer.watchStepCount(data => {
              this.setState({ stepCount: data.steps });
            });
          }}
          title="Listen for step count updates"