-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssue with Retrieving Active Calories Using readRecords in react-native-health-connect #186
Comments
Hi, This should return active calories, as the name suggests. For more details, check the Health Connect documentation. There are no limitations in this library since it's just a wrapper for Google's Health Connect library. |
Hey faced the same issue. after doing some due dilligence, this is my current hypothesis : if you manually add an activity manually for example via google fit and sync it to health connect, active calories will always be 0. by default manually added calories are added to total calories burned. for active calories, the data needs to be returned via a smarwatch meaning "actively records" . if you manually add them , they won't be counted as "ActiveCaloriesBurned" . however they will always be added to TotalCaloriesBurned no matter which method they have been recorded with. For example, pick an empty day , add biking activity manually via google fit with 300kcal. go to health connect , health connect may show 1800kcal. it's not a bug. health connect always returns the BMR ( for eg here it's 1500) + all energies spent during that day no matter if they have been manually or actively records. but the API under the hood , when using active calories burned, will always return the actively recorded records and not the manual ones. hope that helps ! |
Hey matinzd, Thank you for your prompt response. When I manually add active calorie records, I am able to retrieve those entries under ActiveCaloriesBurned using the API. However, I have noticed that calorie data based on steps is not being captured under ActiveCaloriesBurned. Instead, these calories are only available under TotalCaloriesBurned, which includes both active and passive calories. From my testing, it seems that in order to retrieve active calorie data through this SDK, I need to explicitly start an exercise session. Without initiating an exercise, the API does not provide step-based active calorie data, which is critical for my use case. My goal is to track step-based calorie burn without requiring the user to start an exercise session. Could you clarify if there is a way to retrieve ActiveCaloriesBurned data based on steps without starting an exercise, or if this behavior is a limitation of the SDK or the underlying Health Connect library? Looking forward to your guidance on this matter. |
Hello,
I am encountering an issue with retrieving Active Calories Burned data using the readRecords method in the react-native-health-connect package. When I call the readRecords function for 'ActiveCaloriesBurned' with a valid timeRangeFilter, it always returns an empty array [], even though there is active calorie data available.
For reference, here is the code I used:
Interestingly, I can retrieve calorie data only by using 'TotalCaloriesBurned', but this includes both active and passive calories. My requirement is to retrieve only active calories, but the API does not seem to provide the expected data.
Could you please confirm:
If there is an issue with how ActiveCaloriesBurned data is being fetched?
If this is a known issue or limitation of the react-native-health-connect package?
How to accurately fetch only active calorie data using this package?
Looking forward to your response.
The text was updated successfully, but these errors were encountered: