health 14.0.0
health: ^14.0.0 copied to clipboard
Wrapper for Apple's HealthKit on iOS and Google's Health Connect on Android.
14.0.0 #
Added #
- Paged, off-UI-thread data reading for large time ranges:
getHealthDataPages(), returns a lazyStream<HealthDataPage>that fetches the next page only on demand and stops when cancelled (unlikegetHealthDataFromTypes, which returns a single list)Health.pageSize(default20000, max50000, Health Connect limits single calls at 5,000 records) andHealth.isolateMode(HealthIsolateMode.auto[default],worker,inline) to decode and parse large replies in a worker isolate. Both can also be passed toHealth()- Record conversion on Android and HealthKit reply delivery on iOS now run off the UI thread - PR #531
- Android: Heart rate reads use adaptive time slices based on Health Connect sample counts so pages stay near
pageSizewithout splitting individual records
- Optional
limitparameter ongetHealthDataFromTypesto fetch up tolimitnewest data points per type without scanning the entire range - Fixes #279, PR #517 - Structured error handling, see
HealthPlatformException(extendsPlatformExceptionand implementsHealthException) andHealthErrorCode - Android: Reading a data type with write permission but without read permission now returns records written by your own app (matching iOS behaviour), marking those pages with
HealthDataPage.readPermissionDenied. The 30-day history limit does not apply to your app's own records, and workout totals written by your app can be read with the proper write permissions (WRITE_DISTANCE,WRITE_TOTAL_CALORIES_BURNED,WRITE_STEPS). Interval reads still require read permission - Android:
isActivityIntensityAvailable()to check whether the device's Health Connect version supportsACTIVITY_INTENSITYrecords (returnsfalseon iOS) - Writing read-only
HealthDataType.POWER(cycling power on iOS 17+ unitWATT, and any exercise power on Android withREAD_POWER) andHealthDataType.CYCLING_CADENCE(iOS 17+ unitREVOLUTION_PER_MINUTE, Android withREAD_EXERCISE) types throwsArgumentError- PR #487 HealthDataType.VO2_MAXsupport on iOS (vo2Max) and Android (Vo2MaxRecord, requiringREAD_VO2_MAX/WRITE_VO2_MAXand values from0to100). Interval averages are returned on iOS (none on Android) - PR #481HealthDataType.SEXUAL_ACTIVITYsupport (SexualActivityHealthValue,SexualActivityProtection, andwriteSexualActivity()) on Android (SexualActivityRecord, requiringREAD_SEXUAL_ACTIVITY/WRITE_SEXUAL_ACTIVITY) and iOS (HKCategoryTypeIdentifier.sexualActivitywithHKMetadataKeySexualActivityProtectionUsed)- iOS: 41 additional HealthKit quantity types along with new units
LITER_PER_MINUTE,KILOCALORIE_PER_HOUR_KILOGRAM, andAPPLE_EFFORT_SCORE- Fixes #8, Fixes #92, Fixes #95 - PR #522:- iOS 15+:
BASAL_BODY_TEMPERATURE,NUMBER_OF_TIMES_FALLEN,ENVIRONMENTAL_AUDIO_EXPOSURE,HEADPHONE_AUDIO_EXPOSURE,PEAK_EXPIRATORY_FLOW,FORCED_VITAL_CAPACITY,INHALER_USAGE,BLOOD_ALCOHOL_CONTENT,NUMBER_OF_ALCOHOLIC_BEVERAGES,PUSH_COUNT,DISTANCE_WHEELCHAIR,SWIMMING_STROKE_COUNT,DISTANCE_DOWNHILL_SNOW_SPORTS,WALKING_STEP_LENGTH,WALKING_DOUBLE_SUPPORT_PERCENTAGE,WALKING_ASYMMETRY_PERCENTAGE(read-only),APPLE_WALKING_STEADINESS(read-only),STAIR_ASCENT_SPEED,STAIR_DESCENT_SPEED,SIX_MINUTE_WALK_TEST_DISTANCE - iOS 16+:
RUNNING_POWER,RUNNING_SPEED,RUNNING_STRIDE_LENGTH,RUNNING_VERTICAL_OSCILLATION,RUNNING_GROUND_CONTACT_TIME,HEART_RATE_RECOVERY_ONE_MINUTE,ENVIRONMENTAL_SOUND_REDUCTION - iOS 17+:
TIME_IN_DAYLIGHT,PHYSICAL_EFFORT,CYCLING_SPEED,CYCLING_FUNCTIONAL_THRESHOLD_POWER - iOS 18+:
DISTANCE_CROSS_COUNTRY_SKIING,DISTANCE_PADDLE_SPORTS,DISTANCE_ROWING,DISTANCE_SKATING_SPORTS,CROSS_COUNTRY_SKIING_SPEED,PADDLE_SPORTS_SPEED,ROWING_SPEED,WORKOUT_EFFORT_SCORE,ESTIMATED_WORKOUT_EFFORT_SCORE,APPLE_SLEEPING_BREATHING_DISTURBANCES(read-only) - Reading a type on an older iOS version throws
HealthPlatformException(HealthErrorCode.notSupported)
- iOS 15+:
- Android: Full
MINDFULNESSsupport via Health Connect (READ_MINDFULNESS,WRITE_MINDFULNESS). The newwriteMindfulnessSession()writes typed sessions (MindfulnessSessionType:UNKNOWN,MEDITATION,BREATHING,MUSIC,MOVEMENT,UNGUIDED) with optional title and notes. AddedisMindfulnessSessionAvailable()(alwaystrueon iOS), unsupported devices throwHealthException(HealthErrorCode.notSupported), and zero-duration writes throwPlatformException(INVALID_ARGUMENT) - PR #460, PR #510 - iOS:
MINDFULNESSsupport ingetHealthIntervalDataFromTypes, returning deduplicated mindful minutes per interval - iOS:
HealthDataType.SLEEP_UNKNOWNfor reading, interval-aggregating, and deleting HealthKit sleep analysis values not mapped to another sleep type (asleepUnspecifiedremainsSLEEP_ASLEEPand writing throwsHealthException(HealthErrorCode.notSupported)) - iOS:
getRequestStatusForAuthorization()(wrapping HealthKit'sgetRequestStatusForAuthorization(toShare:read:)) returningHealthAuthorizationRequestStatus.shouldRequestorunnecessary, so apps can tell whetherrequestAuthorizationwill display the permission sheet (returnsnullon Android and throwsArgumentErrorfor write access to read-only types andPlatformExceptionon HealthKit errors) - Fixes #397, PR #499 - iOS: Support
WorkoutMetadata(workoutBrandName,indoorWorkout,groupFitness,coachedWorkout) onwriteWorkoutDataandwriteWorkoutDataUUIDto save metadata (ignored on Android) - Fixes #74, PR #452 - Idempotent workout writes in
writeWorkoutDataandwriteWorkoutDataUUIDso re-writing with the same ID and a higher version replaces the existing workout instead of duplicating it: useclientRecordIdandclientRecordVersionon Android (distance and calorie records use<clientRecordId>:distanceand<clientRecordId>:calories, supportsstartZoneOffsetandendZoneOffsetup to ±18 hours) orWorkoutMetadata.syncIdentifierandsyncVersionon iOS (providing only an ID or version throwsArgumentError) - PR #485 - iOS: Add
totalFlightsClimbed,totalSwimmingStrokeCount,duration(excluding pauses, in seconds),avgMets,elevationAscended,elevationDescended,indoorWorkout,weatherTemperature,weatherHumidity,averageSpeed,maximumSpeed, andworkoutEvents(WorkoutEventwithWorkoutEventType,start, andend) for workout metrics and events onWorkoutHealthValue(allnullon Android) - PR #495, PR #522 - Swimming workout support via
SwimmingDetails(poolLengthin meters forSWIMMING_POOL,lapsasList<SwimmingLap>withstartTime,endTime, andSwimmingStrokeStyle) andtotalSwimmingStrokeCount(iOS only) inwriteWorkoutDataandwriteWorkoutDataUUID, readable viaWorkoutHealthValue.swimming(invalid pool lengths or overlapping/out-of-bounds laps throwArgumentErrorbefore writing):- iOS: Saves pool location, lap length (
HKMetadataKeyLapLength), lap events with stroke style (kickboardrequires iOS 16+ andothermaps tounknown), and stroke count.SWIMMING_POOLworkouts with a pool length read back asSWIMMING_POOL(lengths converted to meters) - Android: Saves laps as Health Connect
ExerciseLaprecords (withpoolLengthas lap length) and stroke styles asSWIMMING_*exercise segments (kickboardandotherread back asother,unknownomits a segment).swimmingisnullif a swim has no laps. Health Connect has no stroke count or genericSWIMMINGtype
- iOS: Saves pool location, lap length (
writeSleepSession()to write a complete sleep session with validatedSleepSessionStageentries (SLEEP_AWAKE,SLEEP_AWAKE_IN_BED,SLEEP_ASLEEP,SLEEP_LIGHT,SLEEP_DEEP,SLEEP_REM,SLEEP_OUT_OF_BED,SLEEP_UNKNOWN) - Fixes #526:- Android: Writes a single Health Connect sleep session with its stages, optional title, and notes
- iOS: Writes in-bed samples (excluding out-of-bed stages) and per-stage sleep samples in one call (light, deep, and REM map to asleep before iOS 16; unknown/out-of-bed stages, title, and notes are not stored; sessions over 4 days throw
INVALID_ARGUMENT)
Changed (All Breaking) #
- Raised minimum Dart SDK to
>=3.12.0 <4.0.0and Flutter to>=3.44.0. - Android: Updated
androidx.health.connect:connect-clientto1.2.0-alpha06, requiring AndroidcompileSdk37 and AGP 9.1.0 - PR #491 - Android: Data reads now throw
HealthPlatformExceptionwhen Health Connect returns an error instead of silently returning no data - Android:
getChangesTokenandgetChangesnow throwHealthPlatformExceptionwhen Health Connect returns an error - iOS: Data reads now throw
HealthPlatformExceptionwith classified platform error codes (PERMISSION_DENIED,DEVICE_LOCKED,NOT_SUPPORTED,INVALID_ARGUMENT,DATA_TOO_LARGE, orHEALTH_ERROR). getTotalStepsInIntervalnow returnsFuture<int>instead ofFuture<int?>, returning0when there are no steps and throwingHealthPlatformExceptionon errors - Fixes #237, Fixes #282- iOS:
AudiogramHealthValue.leftEarSensitivitiesandrightEarSensitivitiesare nowList<num?>instead ofList<num> - Updated
getHealthIntervalDataFromTypesreturn format:- Intervals without data are omitted. Do not expect a point for every interval!
- All points return
NumericHealthValue(includingSKIN_TEMPERATUREandACTIVITY_INTENSITY), holding sums for cumulative types, Health Connect intensity minutes forACTIVITY_INTENSITY, and averages for other types - On Android,
HEART_RATEnow returns average BPM instead of sample count. - Sleep types return deduplicated duration in minutes within each interval (including sleep that began before
startDate), withsourceNamelisting contributing apps in start order (bundle identifiers on iOS) and an emptysourceId
HealthDataPointandHealthDataPoint.fromJsonnow keep thevaluepassed to them for sleep, headache, and mindfulness types instead of overwriting it with the duration in minutes (HealthDataPoint.fromHealthDataPointstill computes the duration for platform data). Pass the duration in minutes explicitly when creating these points yourselfHealthDataPoint.sourceDeviceIdreturns device's ID (identifierForVendoron iOS,Build.IDon Android viadevice_info_plus)HealthDataPoint.deviceModelreturns from the recording device instead of always beingnull. Note that because both fields participate inHealthDataPoint ==, points read in 14.0.0 will not equal points persisted by 13.x—compare fields excludingsourceDeviceIdanddeviceModelwhen matching against older stored dataHealthDataPoint.fromHealthDataPoint,HealthChange.fromMethodChannel, andHealthChangesResponse.fromMethodChannelnow accept an optionalsourceDeviceId.- iOS: Workout types that share a HealthKit activity type now map deterministically instead of choosing a name at random per app launch: they read as
RUNNING(orRUNNING_TREADMILLfor indoor runs),CLIMBING, orSWIMMING(SWIMMING_POOLorSWIMMING_OPEN_WATERwhen swimming location metadata is set).RUNNING_TREADMILL(saved as indoor unlessWorkoutMetadata.indoorWorkoutoverrides it) andSWIMMING_OPEN_WATERnow round-trip under the same name,ROCK_CLIMBINGreads back asCLIMBING, andSWIMMING_POOLreads back asSWIMMINGunless written withSwimmingDetails.poolLength.writeWorkoutDataandwriteWorkoutDataUUIDnow acceptRUNNING_TREADMILLandROCK_CLIMBINGinstead of throwingHealthException- Fixes #473 - iOS:
WorkoutSummary.workoutTypenow uses theHealthWorkoutActivityTypename (matchingWorkoutHealthValue.workoutActivityType, e.g.BIKING, orOTHERfor unmapped types) instead of HealthKit's raw type string (e.g.cycling) - Android: Health Connect exercise types shared by multiple workout types now consistently report canonical names across workouts, routes, changes, and UUID reads:
DANCING(forCARDIO_DANCE,SOCIAL_DANCE),SKIING(forCROSS_COUNTRY_SKIING,DOWNHILL_SKIING), andWHEELCHAIR(forWHEELCHAIR_RUN_PACE,WHEELCHAIR_WALK_PACE). writeWorkoutDataandwriteWorkoutDataUUIDnow throwHealthException(HealthErrorCode.notSupported)(ARCHERY,CURLING, andWALKING_TREADMILLon Android (previously returningfalse/empty string) andBIKING_STATIONARYorWALKING_TREADMILLon iOS) - PR #530- Android: Workout
totalDistance,totalEnergyBurned, andtotalStepsnow count only records written by the same app as the workout (matching iOS and preventing double-counting across watch and phone apps). Totals not written by that app arenull. For other app's records readDISTANCE_DELTA,TOTAL_CALORIES_BURNED, orSTEPSover the workout's time range - Fixes #39, Fixes #524, PR #525 writeHealthDataandwriteHealthDataUUIDnow throwArgumentErrorfor types with dedicated write methods- iOS: Requesting
WRITEorREAD_WRITEaccess for read-only HealthKit types or writing them viawriteHealthData/writeHealthDataUUID, now throwsArgumentErrorinstead of crashing or returningfalse/empty string - Android:
writeHealthDatanow returnsfalseandwriteHealthDataUUIDreturns an empty string when Health Connect rejects a value (such as0steps) - iOS:
deletewith a sleep type or headache severity now deletes only your app's samples of that specific type instead of all sleep or headache samples in the range - Android: Reading individual sleep stage types (
SLEEP_ASLEEP,SLEEP_AWAKE,SLEEP_AWAKE_IN_BED,SLEEP_LIGHT,SLEEP_DEEP,SLEEP_REM,SLEEP_OUT_OF_BED,SLEEP_UNKNOWN) viagetHealthDataFromTypesandgetHealthDataPagesnow returns stages starting within[startTime, endTime](including stages from sessions starting up to 24 hours earlier), matching iOS instead of returning every stage of sessions starting in the range.SLEEP_SESSIONreads are unchanged - Android: Passing a
preferredUnitsentry that Android does not convert now throwsHealthException(HealthErrorCode.invalidArgument)before reading instead of mislabeling values - Android: Operations with
ACTIVITY_INTENSITYnow throwHealthException(HealthErrorCode.notSupported)up front on devices whose Health Connect lacks activity intensity support (e.g., Android 15 before SDK extension 16) - Custom classes implementing
HealthorHealthExceptionmust implement the newly added members
Deprecated #
- Breaking:
getHealthAggregateDataFromTypesis deprecated and throwsUnsupportedErrorwithout calling the platform (it has been non-functional since Google Fit was removed). Migrate togetHealthIntervalDataFromTypes.
Removed #
- iOS: Breaking: Removed
TOTAL_CALORIES_BURNEDfrom iOS supported data types as HealthKit does not have a total calories type. UseACTIVE_ENERGY_BURNEDandBASAL_ENERGY_BURNEDon iOS instead - Fixes #483, Fixes #486, PR #484
Fixed #
writeMealno longer dropsb1Thiamin(it was previously sent under an unrecognized key on both platforms)removeDuplicatesnow deduplicates points withmetadata(including all iOS samples and workout routes), ECGs, and audiograms by comparing nested maps and lists by value rather than identity- Fixed
HealthDataPoint.deviceModelfromHKDevice.modelon iOS and Health Connect'sDevice.modelon Android - Fixes #1, Fixes #194, Fixes #229, PR #478 WorkoutSummary.toStringno longer omits the comma after the workout type- Android: Step records whose start and end times are equal no longer cause the entire read to fail on Android 14+ - Fixes #513
- Android:
HEART_RATE,SPEED, andSKIN_TEMPERATUREreads no longer return out-of-range samples and now include in-range samples from records that started up to 24 hours beforestartTime - Android:
getTotalStepsInInterval(includeManualEntry: false)now counts all step records instead of stopping after the first 1,000 - Android:
getHealthIntervalDataFromTypesno longer fails withClassCastExceptionor"Unsupported value"for mass, volume, and duration types (WEIGHT,WATER, sleep,ACTIVITY_INTENSITY), returning values in kilograms, liters, and minutes - Fixes #298 - Android:
getHealthDataByUUIDnow returnsnullinstead of throwing aTypeErrorwhen a record has no data for the requested type - Android: Workouts are no longer omitted when distance, calorie, or step read permissions are missing. Unavailable totals (
READ_DISTANCE,READ_TOTAL_CALORIES_BURNED,READ_STEPS) are returned asnull- Fixes #40, Fixes #184, Fixes #471, Fixes #489, PR #528 - Android: Workout
totalDistance,totalEnergyBurned, andtotalStepsnow sum all records in the workout instead of stopping after the first 1,000 - Android: Prevented duplicate, truncated, or infinitely looping reads (which could exhaust memory or Health Connect quota) when multiple records share the exact same millisecond start time across a page boundary. If more than 5,000 records share one millisecond, reads fail with
HealthErrorCode.unknowninstead of looping (see "Records that share a start time on Android" in README) - Android: Fixed writes swapping
RecordingMethod.manualandRecordingMethod.activewhen saving to Health Connect - Android:
hasPermissions,revokePermissions, and history, background, and feature availability checks no longer crash when Health Connect throws an error - Fixes #116, Fixes #149, Fixes #150, PR #533 - Android:
writeHealthDataUUIDnow checks device feature availability likewriteHealthData, throwingHealthException(HealthErrorCode.notSupported)forSKIN_TEMPERATUREon unsupported devices instead of returning an empty string - Android:
insertWorkoutRouteDatainvalid locations now returnINVALID_ARGUMENT - Android:
BIKING_STATIONARY,SOCCER,HOCKEY(mapped to Health Connect ice hockey), andPADDLE_SPORTS(mapped to paddling, previously iOS-only) can now be written and read instead of failing asOTHER- PR #477, PR #530 - Android:
HealthDataPoint.workoutSummaryis now populated for workouts (matching iOS, with0for missing totals) instead of beingnull- Fixes #490, Fixes #492, PR #535 - Android: Prevented
ClassCastExceptioncrashes on cached Flutter engines whenMainActivityextendsFlutterActivityinstead ofFlutterFragmentActivity, added error logs fixes when permission launchers are unavailable - Fixes #124, PR #511 - Android: Concurrent permission requests no longer overwrite an active Health Connect dialog or crash when it closes, dialog failures now use plugin error codes, and attaching to an already-started activity (e.g., add-to-app with a cached engine) logs an error instead of crashing with
IllegalStateException- PR #508 - Android:
installHealthConnectis now a no-op on Android 14+ - Android:
finishWorkoutRouteno longer drops the workout session's rate of perceived exertion (RPE) when attaching a route - Android: Fixed Android 14/15 Health Connect bug where reading
WORKOUTorWORKOUT_ROUTEthrew aNullPointerExceptionwhen a session with a route fell outside the current page (see "Workouts on Android 14 and 15" in README) - iOS: Fixed a crash when reading audiograms where only one ear was tested at a given frequency
- iOS:
requestAuthorizationno longer crashes when none of the requested types exist on the current iOS version (e.g.,POWERbefore iOS 17) and returnsfalsewithout showing a permission sheet - iOS:
getHealthIntervalDataFromTypesno longer crashes forHEART_RATEand other time-averaged HealthKit types - iOS:
preferredUnitsnow supportsCENTIMETERandMILLIMOLES_PER_LITERand throwsHealthPlatformException(HealthErrorCode.invalidArgument)for incompatible units instead of crashing - iOS: ECG samples with unreadable voltage measurements now fail the read instead of being skipped
- iOS: Invalid writes that previously caused native HealthKit crashes now fail up front with
PlatformException(INVALID_ARGUMENT), including durations over 4 days or ending in year 4001+, incompatible or missing units inwriteHealthData/writeWorkoutData(and*UUIDvariants), andwriteMealcalls with no HealthKit-supported nutrients - iOS:
writeAudiogramno longer hangs whenmetadataomitsHKDeviceNameorHKExternalUUID(optional), and validates frequency count (max 30), ordering, ranges, duration (max 4 days), and string metadata up front withPlatformException(INVALID_ARGUMENT) - iOS:
writeHealthDataUUIDno longer crashes for types or units unavailable on the current iOS version and returns an empty string (matchingwriteHealthDatareturningfalse) - iOS:
writeHealthDataUUIDandwriteWorkoutDataUUIDno longer send two replies for a single call - iOS:
writeHealthDataUUIDwithMINDFULNESSnow returns the saved session UUID (or an empty string on failure) instead of"true"or"false" - iOS:
sourceNameingetHealthIntervalDataFromTypesquantity points - Fixes #1201. Lists sorted contributing bundle identifiers joined with", "(with an emptysourceId, matching Android) - iOS:
writeHealthDataUUIDon iOS 15 now mapsSLEEP_LIGHT,SLEEP_DEEP, andSLEEP_REMto asleep - iOS:
writeMealno longer fails withWRITE_ERRORwhennameis omitted - iOS:
insertWorkoutRouteDatano longer stores missing altitudes as0 m(which caused false climbs and descents). Locations without altitude now read back withoutaltitudeorverticalAccuracy, matching Android - Fixes #51
13.3.2 #
13.3.1 #
- iOS: Fix issues with app crashing on iOS 15
- iOS: Add support for
AppleSleepingWristTemperature- PR #468 - Android: Add support for
SkinTemperatureRecord(READ/WRITE)
13.3.0 #
- Add support for
WORKOUT_ROUTE- PR #454 - Android: Add support for
ActivityIntensityRecord(READ/WRITE/Aggregate) - Update to
androidx.health.connect:connect-client:1.2.0-alpha02
13.2.1 #
No changes - Now the Health package lives in its own repository at https://github.com/carp-dk/carp-health-flutter
13.2.0 #
- Add get health data by UUID (see
getHealthDataByUUID()) - PR #1193, #1194 - Add delete by UUID (
deleteByUUID()) - Add support for unit conversion in
WeightRecord,HeightRecord,BodyTemperatureRecord, andBloodGlucoseRecord- PR #1223 - Update
compileSDKto 36 - Fix #1261 - Update Gradle to 8.9.1
- Update
org.jetbrains.kotlin.androidto 2.1.0 - Update
androidx.health.connect:connect-clientto 1.1.0-rc03 - Update
device_info_plusto 12.1.0 - Fix #1264
13.1.4 #
- Fix adding mindfulness resulted in crash in iOS
- Support SPM for iOS
13.1.1 #
13.1.0 #
13.0.1 #
SwiftHealthPlugin (Main Plugin Class)
├── HealthDataReader (Reading health data)
├── HealthDataWriter (Writing health data)
├── HealthDataOperations (Permissions and deletion)
├── HealthUtilities (Helper functions)
└── HealthConstants (Constants and enums)
13.0.0 #
- Refactored Swift native implementation
12.2.0 #
- iOS: Add
deviceModelin returned Health data to identify the device that generated the data of the receiver. (in iOSsource_namerepresents the revision of the source responsible for saving the receiver.) - Android: Add read health data in background - PR #1184
- Fix #1169 where
meal_typeproperty inNutritionwas null always - iOS: Add
CARDIO_DANCEHealthDataType - #1146
12.1.0 #
- Add delete record by UUID method. See function
deleteByUUID(required String uuid, HealthDataType? type) - iOS: Parse metadata to remove unsupported types - PR #1120
- iOS: Add UV Index Types
- Android: Add request access to historic data #1126 - PR #1127
<!-- Add the following permission into AndroidManifest.xml -->
<uses-permission android:name="android.permission.health.READ_HEALTH_DATA_HISTORY"/>
- Android:
- Update
androidx.compose:compose-bomto2025.02.00 - Update
androidx.health.connect:connect-clientto1.1.0-alpha11 - Update
androidx.fragment:fragment-ktxto1.8.6 - Update to Java 11
- Update
- Update example apps
12.0.0 #
-
BREAKING This release introduces a significant architectural change to the
healthplugin by removing thesingletonpattern.- Dependency Injection for
DeviceInfoPlugin: - The
Healthclass is no longer a singleton. - The
Health()factory constructor is removed. - The
Healthclass now accepts an (optional)DeviceInfoPlugindependency through its constructor, this change was introduced to provide easy mocking of theDeviceInfoclass during unit tests. - This architectural change means that, for the application to work correctly, the
Healthclass 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
Healthclass as a global instance (i.e. do not callHealth()every time but rather define an instancefinal health = Health();).
- For most users, no immediate code changes are required but it is paramount to initialize the
- Dependency Injection for
-
BREAKING (Android) Remove automatic permission request of
DISTANCE_DELTAandTOTAL_CALORIES_BURNEDdata types when requesting permission forWORKOUThealth data type. -
Add
LEAN_BODY_MASSdata type #1078 - PR #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"/> - The following AndroidManifest values are required to READ/WRITE
-
iOS: Add
WATER_TEMPERATUREandUNDERWATER_DEPTHhealth values #1096 -
iOS: Add support for
Underwater Divingworkout #1096 -
Fix issue where iOS delete not deleting own records - PR #1104
-
Fix issue where
SLEEP_LIGHTtype was not aligned correctly - PR #1086 -
Updated
intlto ^0.20.1 #1092 -
Updated
device_info_plusto ^11.2.0 -
Example app: Updated
permission_handlerto ^11.3.1
11.0.0 #
- BREAKING Remove Google Fit support in the Android code, as well as Google FIt related dependencies and references throughout the documentation
- Remove
useHealthConnectIfAvailablefrom the parameters ofHealth().configure() - Remove the
disconnectmethod which was previously used to disconnect from Google Fit. - Remove the
flowRatevalue fromwriteBloodOxygenas this is not supported by Health Connect. - Remove support for various
HealthWorkoutActivityTypes which were supported by Google Fit. Some of these do not have suitable alternatives in Google Health Connect (and are not supported on iOS). The list of removed types can be found in PR #1014
- Remove
- BREAKING introduce a new
RecordingMethodenum- This can be used to filter records by automatic or manual entries when fetching data
- You can also specify the recording method to write in the metadata
- Remove
isManualEntryfromHealthDataPointin favor ofrecordingMethod, of which the value is an enumRecordingMethod - Remove
includeManualEntry(previously a boolean) from some of the querying methods in favor ofrecordingMethodsToFilter. - For complete details on relevant changes, see the description of PR #1023
- Add support for all sleep stages across iOS and Android
- Android: Add support for
OTHERworkout type - Cleaned up workout activity types for consistency across iOS and Android, see PR #1020 for a complete list of changes
- iOS: add support for menstruation flow, PR #1008
- Android: Add support for heart rate variability, PR #1009
- iOS: add support for atrial fibrillation burden, PR #1031
- Add support for UUIDs in health records for both HealthKit and Health Connect, PR #1019
- Fix an issue when querying workouts, the native code could respond with an activity that is not supported in the Health package, causing an error - this will fallback to
HealthWorkoutActivityType.other- PR #1016 - Remove deprecated Android v1 embeddings, PR #1021
10.2.0 #
- Using named parameters in most methods for consistency.
- Added a
HealthPlatformTypeto save which health platform the data originates from (Apple Health, Google Fit, or Google Health Connect). - Android: Improved support for Google Health Connect
- iOS: Add support for saving blood pressure as a correlation, PR #919
10.1.1 #
10.0.0 #
- BREAKING The plugin now works as a singleton using
Health()to access it (instead of creating an instance ofHealthFactory).- This entails that the plugin now need to be configured using the
configure()method before use. - The example app has been update to demonstrate this new singleton model.
- This entails that the plugin now need to be configured using the
- Support for new data types:
- Fixed
SleepSessionRecord, PR #928 - Update to API and README docs
- Upgrade to Dart 3.2 and Flutter 3.
- Added Dart linter and fixed a series of type casting issues.
- Using carp_serializable for consistent camel_case and type-safe generation of JSON serialization methods for polymorphic health data type classes.
9.0.0 #
- Updated HC to comply with Android 14, PR #834 and #882
- Added checks for NullPointerException, closes issue #878
- Updated intl to ^0.19.0
- Upgrade to AGP 8, PR #868
- Added missing google fit workout types, PR #836
- Added pagination in HC, PR #862
- Fix of permission in example app + improvements to doc, PR #875
8.1.0 #
8.0.0 #
7.0.1 #
- Updated dart doc
7.0.0 #
- Merged PR #722
- Added deep, light, REM, and out of bed sleep to iOS and Android HealthConnect
6.0.0 #
5.0.0 #
- Added initial support for the new Health Connect API, as Google Fit is being deprecated.
- Does not yet support
revokePermissions,getTotalStepsInInterval.
- Does not yet support
- Changed Intl package version dependency to
^0.17.0to work with flutter stable version. - Updated the example app to handle more buttons.
4.6.0 #
- Added method for revoking permissions. On Android it uses
disableFit()to remove access to Google Fit -revokePermissions. Documented lack of methods for iOS.
4.5.0 #
- Updated android sdk, gradle
- Updated
enumToStringto native.name - Update and fixed JSON serialization of HealthDataPoints
- Removed auth request in
writeWorkoutDatato avoid bug when denying the auth. - Merged pull requests #653, #652, #639, #644, #668
- Further developed #644 on android to accommodate having the
writeBloodPressureapi. - Small bug fixes
4.3.0 #
- upgrade to
device_info_plus: ^8.0.0
4.2.0 #
- upgrade to
device_info_plus: ^7.0.0
4.1.0 #
- update of
device_info_plus: ^4.0.0 - upgraded to Dart 2.17 and Flutter 3.0
4.0.0 #
- Large refactor of the
HealthDataPointvalue into genericHealthValueand addedNumericHealthValue,AudiogramHealthValueandWorkoutHealthValue - Added support for Audiograms with
writeAudiogramand ingetHealthDataFromTypes - Added support for Workouts with
writeWorkoutand ingetHealthDataFromTypes - Added all
HealthWorkoutActivityTypes - Added more
HealthDataUnittypes - Fix of #432
- updated documentation in code
- updated documentation in README.md
- updated example app
- cleaned up code
- removed
requestPermissionsas it was essentially a duplicate ofrequestAuthorization
3.4.2 #
3.4.0 #
3.2.1 #
- Updated
device_info_plusversion dependency
3.1.0 #
3.0.6 #
- Added two new fields to the
HealthDataPoint-SourceIdandSourceNameand populate when data is read. This allows data points to be disambiguous and in some cases allows us to get more accurate data. For example the number of steps can be reported from Apple Health and Watch and without source data they are aggregated into just "steps" producing an inaccurate result PR#281.
3.0.5 #
- Null safety in Dart has been implemented
- The plugin supports the Android v2 embedding
3.0.4 #
- Upgrade to
device_infoversion 2.0.0
3.0.3 #
- Merged various PRs, mostly smaller fixes
3.0.2 #
- Upgrade to
device_infoversion 1.0.0
3.0.1+1 #
- Bugfix regarding BMI from https://github.com/cph-cachet/flutter-plugins/pull/258
3.0.0 #
- Changed the flow for requesting access and reading data
- Access must be requested manually before reading
- This simplifies the data flow and makes it easier to reason about when debugging
- Data read access is no longer checked for each individual type, but rather on the set of types specified.
2.0.9 #
- Now handles the case when asking for BMI on Android when no height data has been collected.
2.0.8 #
- Fixed a merge issue which had deleted the data types added in 2.0.4.
2.0.7 #
- Fixed a Google sign-in issue, and a type issue on Android (https://github.com/cph-cachet/flutter-plugins/issues/201)
2.0.6 #
- Fixed a Google sign-in issue. (https://github.com/cph-cachet/flutter-plugins/issues/172)
2.0.5 #
- Now uses 'device_info' rather than 'device_id' for getting device information
2.0.4+1 #
- Static analysis, formatting etc.
2.0.4 #
- Added Sleep data, Water, and Mindfulness.
2.0.3 #
- The method
requestAuthorizationis now public again.
2.0.2 #
- Updated the API to take a list of types rather than a single type, when requesting health data.
2.0.1+1 #
- Removed the need for try-catch on the programmer's end
2.0.1 #
- Removed UUID and instead introduced a comparison operator
2.0.0 #
- Changed the API substantially to allow for granular Data Type permissions
1.1.6 #
Added the following Health Types as per PR #147
- DISTANCE_WALKING_RUNNING
- FLIGHTS_CLIMBED
- MOVE_MINUTES
- DISTANCE_DELTA
1.1.5 #
- Fixed an issue with google authorization
- See https://github.com/cph-cachet/flutter-plugins/issues/133
1.1.4 #
- Corrected table of units
1.1.3 #
- Updated table with units
1.1.2 #
- Now supports the data type
HEART_RATE_VARIABILITY_SDNNon iOS
1.1.1 #
- Fixed issue #88 (https://github.com/cph-cachet/flutter-plugins/issues/88)
1.1.0 #
- Introduced UUID to the HealthDataPoint class
- Re-did the example application
1.0.6 #
- Fixed a null-check warning in the obj-c code (issue #87)
1.0.5 #
- Updated gradle-wrapper distribution url
gradle-5.4.1-all.zip - Updated docs
1.0.2 #
- Updated documentation for Android and Google Fit.
1.0.1 #
- Streamlined DataType units in Flutter.