Skip to content
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

[Health: 11.0.0] Cannot get TOTAL_CALORIES_BURNED on iOS #1081

Open
tringuyen53 opened this issue Nov 15, 2024 · 5 comments
Open

[Health: 11.0.0] Cannot get TOTAL_CALORIES_BURNED on iOS #1081

tringuyen53 opened this issue Nov 15, 2024 · 5 comments
Labels
bugfix a bug fix

Comments

@tringuyen53
Copy link

Plugin Name

health

Plugin Version

11.0.0

Device

iPhone 13

Operating System

iOS 17.6.1

Describe the bug

I want to get the number calories burned on Apple Health but it seems it cannot get. Can you provide me the way to get the calories burned? Currently I'm using TOTAL_CALORIES_BURNED data type. I saw that when it requests permission from my iPhone, I don't see any permission that relevant to calories burned.

Steps to Reproduce

Just call getHealthDataType with TOTAL_CALORIES_BURNED

Expected Behavior

List of calories burned returned.

Actual Behavior

List of calories burned return nothing.

Flutter Logs

No response

Screenshots

No response

Flutter Doctor Output

[√] Flutter (Channel stable, 3.16.9, on Microsoft Windows [Version 10.0.22631.4391], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.9.6)
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.95.3)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.

Additional Information

No response

@tringuyen53 tringuyen53 added the bugfix a bug fix label Nov 15, 2024
@tntkhang
Copy link

Refer this issue for the solution: #1072

@tringuyen53
Copy link
Author

Refer this issue for the solution: #1072

Okay, so in iOS i used ACTIVE_ENERGY_BURNED instead of TOTAL_CALORIES_BURNED and it works well.
But do you know in android how can I get ACTIVE_ENERGY_BURNED? I only get TOTAL_CALORIES_BURNED from Health Connect.
Besides, in my android device, Health Connect only have TOTAL_CALORIES_BURNED data from Google Fit, but it cannot get any TOTAL_CALORIES_BURNED or ACTIVE_ENERGY_BURNED data from Samsung Health.

@HassanAlyousef
Copy link

Health connect is still buggy when it comes to reading health data from the health app, I faced the same issue with Samsung Health, distance & calories are present but Health Connect doesn't read them thus I cannot show them in my application, I'm not sure there is anything we can do about that unfortunately unless there is something that I don't know about

@tringuyen53
Copy link
Author

Health connect is still buggy when it comes to reading health data from the health app, I faced the same issue with Samsung Health, distance & calories are present but Health Connect doesn't read them thus I cannot show them in my application, I'm not sure there is anything we can do about that unfortunately unless there is something that I don't know about

I'm still facing the same problem. I've tried to test by manually write active calories data into health connect and then my application can load calories data. So it just about why samsung health doesnt write calories into health connect.

@HassanAlyousef
Copy link

Yes writing directly into Health Connect will obviously work, but not reading an actual data from the Health application is a big problem because that's what you're going to deal with, I've seen people even non-developers facing the same inconsistency with Health connect so hopefully it gets an update or a fix soon

@iarata iarata changed the title [<health> <11.0.0>] Cannot get TOTAL_CALORIES_BURNED on iOS [Health: 11.0.0] Cannot get TOTAL_CALORIES_BURNED on iOS Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix a bug fix
Projects
None yet
Development

No branches or pull requests

3 participants