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 12.0.0 #1117

Merged
merged 63 commits into from
Jan 15, 2025
Merged

Health 12.0.0 #1117

merged 63 commits into from
Jan 15, 2025

Conversation

iarata
Copy link
Contributor

@iarata iarata commented Jan 15, 2025

  • BREAKING This release introduces a significant architectural change to the health plugin by removing the singleton pattern.
    • Dependency Injection for DeviceInfoPlugin:
    • The Health class is no longer a singleton.
    • The Health() factory constructor is removed.
    • The Health class now accepts an (optional) DeviceInfoPlugin dependency through its constructor, this change was introduced to provide easy mocking of the DeviceInfo class during unit tests.
    • This architectural change means that, for the application to work correctly, the Health class MUST be initialized correctly as a global instance.
    • Impact:
      • For most users, no immediate code changes are required but it is paramount to initialize the Health class as a global instance (i.e. do not call Health() every time but rather define an instance final health = Health();).
  • BREAKING (Android) Remove automatic permission request of DISTANCE_DELTA and TOTAL_CALORIES_BURNED data types when requesting permission for WORKOUT health data type.
    • For WORKOUTs that require above permissions, now those need to be requested manually.
    • Fix #984 - Closes #1055
  • Add LEAN_BODY_MASS data type - Closes #1078 - Closes #1097
    • The following AndroidManifest values are required to READ/WRITE LEAN_BODY_MASS:
    <uses-permission android:name="android.permission.health.READ_LEAN_BODY_MASS"/>
    <uses-permission android:name="android.permission.health.WRITE_LEAN_BODY_MASS"/>
  • iOS: Add WATER_TEMPERATURE and UNDERWATER_DEPTH health values - Closes #1096
  • iOS: Add support for Underwater Diving workout - Closes #1096
  • Fix #1072 and Fix #1074
  • Fix issue where iOS delete not deleting own records - Closes #1104
  • Fix #950 - Closes #1103
  • Fix #1047 and Fix #939 - Closes #1091
  • Fix issue where SLEEP_LIGHT type was not aligned correctly - Closes #1086
  • Fix #1051 - Closes #1052
  • Updated intl to ^0.20.1 - Fix #1092
  • Updated device_info_plus to ^11.2.0
  • Example app: Updated permission_handler to ^11.3.1

avargas-btf and others added 30 commits September 25, 2024 18:09
Health data query to use HKStatisticsCollectionQuery instead of HKStatisticsQuery
Iarata/health-12 base branch
When deleting entries on iOS a compound predicate is used to limit the query to entries the calling app has created. Otherwise the call fails is the sample contains entries from other apps.
[Health] Deleting entries in iOS only selects own entries

To reproduce the issue:
Add data to the iOS Health using the "Add Data" button in example app, and try to delete using the "Delete Data" button. The steps, for example, will always be there and won't be deleted.
Health 12/1104 - iOS delete not deleting own
[Health] Fix NullPointerException when reading NUTRITION
iarata and others added 26 commits January 6, 2025 14:56
…ving

Add support for WaterTemperature and UnderwaterDepth data types and UnderwaterDiving workout in iOS
# Conflicts:
#	packages/health/example/ios/Runner.xcodeproj/project.pbxproj
[Health] Updated device_info_plus version dependency
…-info

Health 12/1095 update dependencies versions
[Health] fixed hasPermissoins call for iOS
[health] Remove automatically added workout permissions
…orkout-permissions

Health 12/1055 remove auto workout permissions
Fix `HealthDataType was not aligned correctly` when adding SLEEP_LIGHT data
[Health] Register WorkoutHealthValue
Health 12/1052 Register `WorkoutHealthValue`
feat: refactor `Health` class to remove singleton pattern and enable dependency injection for `DeviceInfoPlugin`
@iarata iarata requested a review from bardram January 15, 2025 16:33
Copy link
Contributor

@bardram bardram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Added some documentation in places.

@bardram bardram merged commit fcac28a into master Jan 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment