Closed ychinamale closed 10 months ago
Try to twist around bucket unit
and bucket interval
to observe any change happens. It's based on api estimation so it's pretty normal to see mismatch as well as data delay/sync.
Also, for the startDate
and endDate
, maybe use 3rd party date libs like moment
(it's in our deps so you can actually import it directly) instead of Date()
. In some edge cases, Default Date() will cause wrong date range due to timezone.
I had simillar problem with bad calculations of daily steps and I fixed it by setting starting date on start of the day, and end date by end of the day. And everything is calculating as in Google Fit app
Problem
When I call
GoogleFit.getDailyStepCountSamples()
to retrieve steps, I receive a step count that significantly lower than that shown in the Google Fit app.Dev Environment
MacOS Big Sur React Native 0.63.3 Android Simulator - Nexus 5 API 19
Steps to Replicate
Set your step options and call the function. The code would look something like the following
In the resulting log, observe data from any
com.google.android.gms
source. Look at the total steps, and the rawSteps. Compare this with the total number of steps shown in the Google Fit app for the same day (Can be found by opening the Google Fit app -> Home -> Trends/Steps -> Day -> See source data)What I Observe
There is a mismatch between both the total steps and the rawSteps
What I Expected
Screenshot
On the left is a screenshot of log after running my code. The right is a screenshot of the raw data according to the Google Fit app.