Write data returns String? uuid instead of boolean - #448
Merged
Merged
Conversation
- Update `writeData` to return string `uuid` - Update `writeWorkoutData` to return string `uuid`
- Update `writeHealthData` to return string `uuid` - Update `writeWorkoutData` to return string `uuid`
- Create `addSingleHealthData` to push a dummy steps data - Create `addSingleWorkoutData ` to push a dummy running data
|
I can imagine this not getting merged because it breaks backwards compatibility. That being said, I think it's necessary and would love if this PR got merged. Especially given that you need the UUID to delete the record (as opposed to the sketchy deletion by time-range). But in case the maintainers don't want to introduce a breaking change, we could expose two methods. One that returns a boolean and one that returns a string. But again, I'd advocate for merging this as is (with a corresponding major version bump). |
|
@agilst can you please prioritize this? |
ytsni
added a commit
to ytsni/health_bridge
that referenced
this pull request
May 24, 2026
New features: - VO2 Max data type support (iOS + Android read/write) - Mindfulness data type on Android (read/write) - writeHealthData/writeWorkoutData now return String? UUID instead of bool (BREAKING: callers checking `== true` must check `!= null`) - Swift Package Manager support for iOS (sources moved to ios/health/Sources/health/, Package.swift added) - CocoaPods still works via updated podspec Cherry-picked from upstream: - carp-dk#481: VO2 Max - carp-dk#460: Mindfulness on Android - carp-dk#448: UUID return from write methods - carp-dk#488: SPM support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ytsni
added a commit
to ytsni/health_bridge
that referenced
this pull request
May 24, 2026
New features: - VO2 Max data type support (iOS + Android read/write) - Mindfulness data type on Android (read/write) - writeHealthData/writeWorkoutData now return String? UUID instead of bool (BREAKING: callers checking `== true` must check `!= null`) - Swift Package Manager support for iOS (sources moved to ios/health/Sources/health/, Package.swift added) - CocoaPods still works via updated podspec Cherry-picked from upstream: - carp-dk#481: VO2 Max - carp-dk#460: Mindfulness on Android - carp-dk#448: UUID return from write methods - carp-dk#488: SPM support
This reverts commit 2c77771.
This reverts commit 4bd8c9c.
This reverts commit 25d1c3b.
* Add write data to return uuid on iOS and Android - Add `writeDataUUID` to return string `uuid` - Add `writeWorkoutDataUUID` to return string `uuid` * Add health data functions to return uuid - Add `writeHealthDataUUID` to return string `uuid` - Add `writeWorkoutDataUUID` to return string `uuid` * Update example screen - Create `addSingleHealthData` to push a dummy steps data - Create `addSingleWorkoutData ` to push a dummy running data Tested on Android and iOS (passed)
Contributor
Author
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is recreated from carp-dk/flutter-plugins#1241, and there are some adjustment to inline documentations.
writeHealthDataandwriteWorkoutDatais now returnsString? uuidusingInsertRecordsResponse.recordIdsList.firstOrNull()on Android andHKObject.uuid.uuidStringon iOS. Please note that there is no extra efforts added when writing health data.This is useful for some apps that need to utilise
uuidonce successfully writing health data (e.g. store into database for future use).