Expo Docs

Hey friend! We are co-hosting a conference with Software Mansion, learn more.

Pedometer

Use Core Motion (iOS) or Google Fit (Android) to get the user's step count.

Determine whether the pedometer is available.

  • Returns a promise that resolves to a Boolean, indicating whether the pedometer is available on this device.

Get the step count between two dates.

  • start (Date) -- A date indicating the start of the range over which to measure steps.
  • end (Date) -- A date indicating the end of the range over which to measure steps.

  • Returns a promise that resolves to an Object with a steps key, which is a Number indicating the number of steps taken between the given dates.

Subscribe to pedometer updates.

  • callback (function) A callback that is invoked when new step count data is available. The callback is provided a single argument that is an object with a steps key.

  • An EventSubscription object that you can call remove() on when you would like to unsubscribe the listener.

You'll need to configure an Android OAuth client for your app on the Google Play console for it to work as a standalone application on the Android platform. See https://developers.google.com/fit/android/get-api-key