sahha_flutter 1.5.2
sahha_flutter: ^1.5.2 copied to clipboard
Sahha Flutter Plugin
1.5.2 #
Moves to the native 1.5.2 SDKs: a fix for an iOS crash shortly after start-up, getDemographic, getScores and getBiomarkers results that are the same on iOS and Android, and a fix for a foreground service that Android refused.
Added #
- iOS:
getScoresandgetBiomarkersreturn every field the Sahha API sends, including fields the API adds after this release, as Android already does. - iOS: if HealthKit answers one of the SDK's requests twice, the SDK reports it to Sahha as an error starting "HealthKit repeated a completion", naming the call, the sensor where there is one, and both answers.
Changed #
- iOS:
getDemographicnow always returns the demographic as Sahha stores it:genderasMale,FemaleorGender Diverse, andbirthDateas a date-time such as1990-05-20T00:00:00. These are the values Android returns. For the first hour afterpostDemographic, earlier versions returned the strings the app had posted (for examplefemaleand1990-05-20) and switched to the stored form afterwards. If your app compares the result with what it posted, or readsbirthDateas a plain date, allow for the stored form. - iOS: the first
getDemographicafterpostDemographicreads from Sahha instead of the device, so it needs a connection. Without one it throws aPlatformException. - iOS: the JSON from
getScoresandgetBiomarkersis now the API's response as it was sent. Keys are in the API's order and the same on every call, and/is no longer written as\/(a unit readsmg/dL, notmg\/dL). The values are the same as before, so an app that parses the JSON needs no change. - Updated iOS to 1.5.2 — check release notes https://github.com/sahha-ai/sahha-ios/releases
- Android: diagnostic reports now say whether Android will let sync run as a
healthforeground service. - Updated Android to 1.5.2 — check release notes https://github.com/sahha-ai/sahha-android-sdk/releases
Fixed #
- iOS: an app could crash within seconds of
configureorauthenticatewhen HealthKit answered one of the SDK's requests twice. The SDK now takes the first answer and ignores a repeat. - iOS: after posting only
genderor onlybirthDate,getDemographicreturned just that field for up to an hour, even when the profile had the other one stored. It now returns both. - iOS:
getScoresno longer throws aPlatformExceptionwhen a score or one of its factors has no value forstate,score,valueorgoal. The score is returned withnullin that field, as on Android. - Android:
getScoresandgetBiomarkersnow return an empty JSON array ([]) when there is nothing to return, the same as iOS. They returned{}. If your app compares the result with'{}'to detect "no data", check for an empty list instead. - Android: on Android 14 and later, sync no longer asks for a
healthforeground service that Android refuses. When the app holds none of the permissions that type needs (the SDK declaresACTIVITY_RECOGNITION), sync runs without one, and WorkManager no longer logs aSecurityExceptionon every sync. - Android: after such a refusal the SDK went on as if sync were a foreground service. It now checks that the service really started. When it has not, a sync cycle that runs after the app is left reads Health Connect only if background read is granted.
1.5.0 #
Moves to the native 1.5.0 SDKs: fixes for HealthKit sync and background uploads on iOS (including iOS 27), and for memory use and sync reliability with Health Connect on Android.
Added #
- iOS: HealthKit query timeout reports now include the page size, sync progress, query-slot usage and app state, so a slow sync can be diagnosed from the Sahha dashboard.
Changed #
- iOS:
getDemographicnow resolves withnullwhen the profile has no demographic stored, matching Android. Previously it threw aPlatformException. Real errors still throw as before. - iOS: HealthKit sync runs at most four queries at once across all sensors, so a launch with many enabled sensors no longer queries HealthKit for all of them at the same time.
- iOS: device lock and unlock events upload at high priority, alongside health data.
- Android: diagnostic reports are queued and sent when the network is available; a report that fails because the device is offline is no longer logged as an error.
- Android: only one sync cycle runs at a time; a sync requested while another is running runs as a follow-up cycle.
- The example app builds and launches with Xcode 27 and the iOS 27 SDK (UIScene lifecycle, pod deployment targets raised to iOS 15.0).
- Updated iOS to 1.5.0 — check release notes https://github.com/sahha-ai/sahha-ios/releases
- Updated Android to 1.5.0 — check release notes https://github.com/sahha-ai/sahha-android-sdk/releases
Fixed #
- iOS: a health data type no longer stops collecting for good after a large deletion in Apple Health (such as a sync app rewriting its history); collection continues past the deleted records.
- iOS: a sensor whose HealthKit query keeps timing out now fetches smaller pages instead of retrying the same query, so it keeps making progress.
- iOS: the app is no longer terminated when a HealthKit background sync or background upload outlasts its background time; unsent data stays queued for the next upload.
- iOS 27: a permission request made straight after another one (including two
enableSensorscalls in a row for new sensors) now shows its Health sheet and completes, instead of failing after two minutes. - iOS: data collected on a background wake is uploaded once, and data queued just as an upload finished is sent straight away.
- iOS: a failed or interrupted upload no longer leaves duplicate copies of the batch in the on-device retry queue.
- iOS: a profile with no demographic stored now gets its gender and birth date filled in from Apple Health where the user has allowed it, instead of logging an error on every launch.
- Android: no more out-of-memory crashes on devices with a large Health Connect backlog; data is read and uploaded page by page, and an interrupted first sync resumes where it stopped.
- Android: Health Connect records are no longer lost when a sync is stopped, the app is killed mid-sync, or the device details upload fails.
- Android: a failing upload batch is tried once per sync cycle instead of up to 100 times.
- Android:
getStatsno longer returns 0 for the average resting heart rate. - Android:
postDemographicacceptsgenderin any letter case (for example"male"). - Android:
deauthenticateclears every copy of the sign-in and waits for a running sync to finish, so nothing is sent or written for the old profile afterwards. - Android: the sync on device boot no longer runs while signed out or with no sensors enabled, and a sync requested while an earlier one was waiting to retry now runs straight away.
- Android: the foreground sync notification no longer shows the placeholder text "Title" and "Short description" when
notificationSettingsleaves them out; the Sahha SDK's default text is used instead.
1.4.0 #
Stable release of the 1.4.0 line, consolidating the 1.4.0-beta.1 and 1.4.0-beta.2 changes with the final native 1.4.0 SDKs.
Added #
engagementbiomarker category inSahhaBiomarkerCategory.- Android: skipped unreadable Health Connect records are now reported to Sahha error telemetry, so affected devices are visible without device logs.
Changed #
- Breaking:
SahhaBiomarkerCategorynow contains exactly the six documented categories (activity,body,engagement,nutrition,sleep,vitals). Removedcharacteristicandreproductive, which never returned biomarker data. - Breaking: renamed
SahhaBiomarkerType.activity_mid_intensity_durationtoactivity_medium_intensity_duration, matching the server vocabulary — the old name always returned no data. - Deprecated
getStatsandgetSamples— usegetBiomarkersto read server-processed biomarkers instead. - Stat and sample
categoryvalues now carry the sensor's data-log logType — the same label stamped on uploaded data on both platforms: heart rate types reportheart, blood pressure/glucose reportblood, oxygen/VO2 max/respiratory rate reportoxygen, temperature types reporttemperature, and energy/daylight types reportenergy.vitalsno longer appears. - Rebuilt the example app as a full SDK testing harness.
- Updated iOS to 1.4.0 — check release notes https://github.com/sahha-ai/sahha-ios/releases
- Updated Android to 1.4.0 — check release notes https://github.com/sahha-ai/sahha-android-sdk/releases
Fixed #
- iOS: sensor sets with no HealthKit-backed types (such as
device_lockalone, or Android-only sensors) no longer make permission requests throw "Health data types not specified" — requesting permissions now succeeds as a no-op and sensor status reports correctly through the normal lifecycle. - iOS:
enableSensorsno longer risks hanging indefinitely without invoking its callback; profile token refresh and session-expiry handling are hardened against transient network and server errors. - Android:
enableSensorsreports the real sensor status reliably (the native callback now returns aSahhaSensorStatus). - Android: eliminated phantom step spikes caused by step-counter regressions and implausible jumps; reboots are detected reliably, and steps recorded during collection outages are recovered.
- Android: Health Connect reads now step around records the client library cannot parse instead of dropping the surrounding data, and an interrupted read no longer advances the sync marker past unread data.
- Android:
getSamplesfor steps no longer returns empty or partial results after background sync has run, and queries no longer interfere with upload de-duplication. - Android: device-lock events are now stamped with the correct phone form factor.
1.4.0-beta.2 #
Added #
Changed #
- Updated iOS to 1.4.0-beta.2 — check release notes https://github.com/sahha-ai/sahha-ios/releases
- Updated Android to 1.4.0-beta.2 — check release notes https://github.com/sahha-ai/sahha-android-sdk/releases
Fixed #
- Android:
getSamplesfor steps no longer returns empty or partial results — step queries previously shared the background upload pipeline's de-duplication state, hiding records already collected by sync (fixed in the native 1.4.0-beta.2 release).
1.4.0-beta.1 #
Added #
engagementbiomarker category inSahhaBiomarkerCategory.
Changed #
- Breaking:
SahhaBiomarkerCategorynow contains exactly the six documented categories (activity,body,engagement,nutrition,sleep,vitals). Removedcharacteristicandreproductive, which never returned biomarker data. - Breaking: renamed
SahhaBiomarkerType.activity_mid_intensity_durationtoactivity_medium_intensity_duration. The old name was outside the documented vocabulary and silently returned no data. - Deprecated
getStatsandgetSamples— usegetBiomarkersto read server-processed biomarkers instead. - Stat and sample
categoryvalues are now labeled with the sensor's data-log logType: heart rate types reportheart, blood pressure/glucose reportblood, oxygen/VO2 max/respiratory rate reportoxygen, temperature types reporttemperature, and energy/daylight types reportenergy.vitalsno longer appears. - Rebuilt the example app as a full testing harness — biomarker, score, stats and samples query screens with type selectors and date ranges, a checked-list sensor permissions screen, a per-sensor diagnostics screen, and a Material 3 UI.
- Updated iOS to 1.4.0-beta.1 — check release notes https://github.com/sahha-ai/sahha-ios/releases
- Updated Android to 1.4.0-beta.1 — check release notes https://github.com/sahha-ai/sahha-android-sdk/releases
Fixed #
- iOS:
enableSensorscallback no longer hangs indefinitely; hardened token refresh and session-expiry handling. - Android:
enableSensorsreports sensor status reliably, plus Health Connect read-robustness fixes from the native 1.4.0-beta.1 release.
1.3.9 #
Added #
Changed #
- Updated IOS to 1.3.9 check release notes https://github.com/sahha-ai/sahha-ios/releases
- Updated Android to 1.3.9 check release notes https://github.com/sahha-ai/sahha-android-sdk/releases
Fixed #
- Fixed an Android crash in host apps that don't include a
res/drawable/notificationicon — the background collection and sync notifications now fall back to a bundled Sahha icon instead of crashing withInvalid notification (no valid small icon).
1.3.9-beta.5 #
Added #
Changed #
- Updated IOS to 1.3.9-beta.5 check release notes https://github.com/sahha-ai/sahha-ios/releases
- Updated Android to 1.3.9-beta.5 check release notes https://github.com/sahha-ai/sahha-android-sdk/releases
Fixed #
1.3.9-beta.4 #
Added #
Changed #
- Updated IOS to 1.3.9-beta.4 check release notes https://github.com/sahha-ai/sahha-ios/releases
- Updated Android to 1.3.9-beta.4 check release notes https://github.com/sahha-ai/sahha-android-sdk/releases
Fixed #
- Fixed an Android crash in host apps that don't include a
res/drawable/notificationicon — the background collection and sync notifications now fall back to a bundled Sahha icon instead of crashing withInvalid notification (no valid small icon).
1.3.9-beta.2 #
Added #
Changed #
- Updated IOS to 1.3.9-beta.2 check release notes https://github.com/sahha-ai/sahha-ios/releases
- Updated Android to 1.3.9-beta.2 check release notes https://github.com/sahha-ai/sahha-android-sdk/releases
Fixed #
1.3.9-beta.1 #
Added #
Changed #
- Updated IOS to 1.3.9-beta.1 check release notes https://github.com/sahha-ai/sahha-ios/releases
- Updated Android to 1.3.9-beta.1 check release notes https://github.com/sahha-ai/sahha-android-sdk/releases
Fixed #
1.3.8 #
1.3.7 #
1.3.5 #
Added #
- New Android SDK integrated, this is a full refactor of the Sahha Android SDK.
- Improved Native Step and Sleep tracking - Requires Android Manifest to include Write permissions for Steps and Sleep.
- New Synchronisation and batching logic for Android.
Changed #
- Upgraded to the latest stable Flutter version 3.38.7.
- Updated to the latest supported Dart version 3.10.7.
- Upgraded to the latest AGP version 9.0.
- Upgraded Kotlin to the latest stable version 2.3.0.
- Motion Permission is now optional, this can be configured on or off by passing enableMotionTrigger: true to the configure function.
- Background task protection and Upload loop reliability improved.
Fixed #
- Fixed a bug where the network monitor couldn't restart after being stopped.
- Fixed discrepancy between Android and IOS Score / Biomarker response objects.
- Fixed issue where IOS was returning Score Factors without ID or Unit.
1.2.7 #
1.2.5 #
1.2.0 #
1.1.8 #
1.1.7 #
1.1.5 #
Added #
- Added aggregates to data logs
- Added new activity sensors
Changed #
- Changed how app session logs are formatted
Fixed #
- (Android) Fixed an issue that could cause unnecessary battery drain
- (Android) Fixed an issue where the foreground service would launch intermittently
- (Android) Added namespace declaration to
build.gradle
1.1.4 #
Added #
- Added
categoryto samples and stats - Added
deviceIdto the data logs - Added exercise stats
- (iOS) Added optional stats list on samples
Changed #
- (Android) Made changes to how native sleep collection is handled
- (Android) Improved how the SDK handles large amounts of data logs at once
Fixed #
- (Android) Fixed an issue for Android version 13 and below regarding behaviour between installing HealthConnect during the permission flow
1.1.1 #
Added #
- (Android) Added rules for consumer-rules.pro for developers using pro guard obfuscation
Changed #
- Adjusted sleep data window to 6pm - 6pm for
getStats - Added a
deviceIdto device information - (iOS) Split Stats by source
Fixed #
- (Android) Fixed an issue when posting data was not being cancelled when de-authenticating
1.1.0 #
1.0.9 #
1.0.8 #
1.0.6 #
Added #
- Added
getBiomarkersto retrieve biomarker data - Added app event logs for lifecycle changes
Changed #
- (Android) Changed
authenticateto return an "in progress" error if an authentication is already in progress - (Android) Adjusted metadata for data logs
Fixed #
- (Android) Hotfixed an issue where device information sometimes would not send
Note: The MainActivity within the project's android folder will need to be changed to use FlutterFragmentActivity instead.
1.0.5 #
1.0.3 #
1.0.2 #
1.0.1 #
Added #
n/a
Changed #
n/a
Fixed #
- (Android) Resolved an issue where under certain circumstances, native step data would stop collecting (Health Connect step data unrelated)
- (Android) Resolved an issue where certain permission states were incorrectly returning
unavailablespecifically for Android version 9 (API 28)
1.0.0 #
0.4.5 alpha #
Added #
- (Android) Improved the quality of step data being sent to Sahha API
Changed #
- Changed
getSensorStatusandenableSensorsmethod parameters to require an explicit list of sensors
Fixed #
- (iOS) Delete credentials if API response is unauthorized
- (Android) Fixed a bug where the foreground service would attempt to periodically restart
- (Android) Fixed a minor bug when batching data
0.4.4 alpha #
Added #
- n/a
Changed #
- (iOS) Moved data handling and posting to a dedicated data manager
- (Android) Improved data handling and posting
Fixed #
- (iOS) Fixed missing device information for logging
- (iOS) Fixed warnings for missing credentials
- (Android) Fixed deauthentication to properly halt background tasks and reset data
0.4.3 alpha #
0.4.2 alpha #
0.4.1 alpha #
0.4.0 alpha #
Added #
- Added exercise sensor
- (iOS) Collected gender and birth date from HealthKit
Changed #
- Improved batching of sensor data uploads
- (Android) Permissions must be added manually by the developer to AndroidManifest.xml
- (Android) Improved how Health Connect data is queried
- (Android) Adjusted how sensor data percentages are formatted
- (iOS) Increased historical sensor data from 7 days to 30 days
Fixed #
- (Android) Fixed sleep value formatting
- (Android) Fixed a bug which caused diastolic blood pressure data to be missing
0.3.9 alpha #
0.3.8 alpha #
Added #
- n/a
Changed #
- (Android) Improvements to ensure important background tasks continue running
- (Android) Upgraded to latest Gradle version
Fixed #
- (Android) Fixed a bug that would sometimes crash on initial launch
- (Android) Fixed a bug that could lock up the UI on lower Android OS versions
- (Android) Fixed a bug where permission status would return disabled when it should be unavailable on lower Android OS versions
0.3.7 alpha #
0.3.5 alpha #
0.3.4 alpha #
Added #
- Added temperature sensor data
- Added additional error logging
Changed #
- Renamed data_types and insight_types to snake_case
- Removed manual postSensorData method
Fixed #
- (Android) Fixed some insights not posting correctly
- (Android) Fixed some demographics not posting correctly
- (iOS) Fixed some sensor data not posting correctly