cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
550 stars 678 forks source link

[Health 11.0.0] RecordingMethod.unknown returned for automatically added steps in Google Fit #1036

Closed tejasbadone closed 2 months ago

tejasbadone commented 2 months ago

Device / Emulator and OS

Please complete the following information for each phone and/or emulator you're experiencing this bug on:

Describe the bug

When retrieving step data from Google Fit using the health package version 11.0.0, the RecordingMethod is returned as unknown even for steps that are automatically added by Google Fit. This issue occurs consistently, preventing accurate identification of the recording method.

To Reproduce

  1. Run the example app provided in the repository.
  2. Grant Health Connect permissions.
  3. Click the "Fetch Data" button.
  4. Check the steps data in the list.

Expected behavior

Recording method should be returned as RecordingMethod.automatic for automatically added steps.

Actual behavior

Recording method returned as RecordingMethod.unknown for automatically and manually added steps too.

Screenshots

health health1 health2

Flutter doctor

[√] Flutter (Channel stable, 3.24.1, on Microsoft Windows [Version 10.0.19045.4780], locale en-IN) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Chrome - develop for the web [X] Visual Studio - develop Windows apps X Visual Studio not installed; this is necessary to develop Windows apps. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components [!] Android Studio (version 2023.2) X Unable to determine bundled Java version. [√] Android Studio (version 2023.3) [√] VS Code (version 1.93.0) [√] Connected device (4 available) [√] Network resources

! Doctor found issues in 2 categories.

SlimShadyIAm commented 2 months ago

Unfortunately, this is a limitation of how Google Fit adds the steps to Health Connect. The records added don't contain the recording method in the metadata and "unknown" is the default.