DEV Community

Josué Rodríguez (He/Him)
Josué Rodríguez (He/Him)

Posted on • Edited on

Expo Pedometer not returning step count in Android

Hello everybody, today I need help.
I'm developing an app with React Native and Expo.

I'm having issues with the Pedometer included in "expo-sensors". The problem is, the function Pedometer.getStepCountAsync does not work in Android, the function returns "Getting step count for date range is not supported on Android yet". I've been reading about this issue and found out that it is an Expo problem, the function worked perfectly around Expo 32, but with the updates, it stopped working.

Does anyone know a workaround for this issue? Or does anyone know how to retrieve the steps the user has taken in the day (with this module or any other)? I would really appreciate any help!

March 26, 2021 Edit:

One year later, I didn't find a solution for this. I've seen the issue I opened on GitHub getting more comments about "I've got the same issue. If many people have this issue why don't they do something?", but no concrete answer (at least, since the last time I checked).

The most promising thing I found (but didn't test since I was moved from that project) was using the Google Fit API to record the steps the user takes. Hope this helps somebody, and if anybody ever finds a working solution, please leave it in the comments for everyone to see 😊

Top comments (5)

Collapse
 
sinalayazali profile image
sinalayazali

have you found any solution for this problem?

Collapse
 
josuerodriguez98 profile image
Josué Rodríguez (He/Him)

Hello! Sadly, I didn't find any solution. The most promising thing I came up with while reading was using Google Fit API.

Collapse
 
daniel_richter_cb2fc94c24 profile image
Daniel Richter

How you solve this way? im not able to get it run. Is there any tutorial on this?

Thread Thread
 
josuerodriguez98 profile image
Josué Rodríguez (He/Him)

Hello Daniel. I was taken off this project before trying to implement this. I only read that it was the most viable solution, but I also read that not all Android Phones support the GoogleFit API. I wish I could be of more help to you, but that's all I can say 😅

Collapse
 
danielfrico profile image
Daniel Fernando Rico León

It seems to be a development problem. When you build your apk and test the app counter is working. Of course there are some previous steps like add permissions request