Strange property of Expo.Pedometer.getStepCountAsync

Hey guys, I’m not sure if it’s problem with Expo or iOS pedometer, but I noticed strange behavior described below.

Imagine we have interval t1 - t2 separated by t0, i.e. t1 < t0 < t2. Now if we take step count in each of these intervals:

import { Pedometer } from 'expo';

const steps1 = await Pedometer.getStepCountAsync(t1, t0);
const steps2 = await Pedometer.getStepCountAsync(t0, t2);
const steps3 = await Pedometer.getStepCountAsync(t1, t2);

I would expect the following difference to be close to 0 (if not 0 all the time):

difference = steps1 + steps2 - steps3

But I noticed, that in practice, this is often not true. The difference might be 100, 200 or even 1000 steps. What’s worse, if you try to “move” t0 in the example, this difference also changes.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.