Skip to content

Conversation

@agilst
Copy link
Contributor

@agilst agilst commented Oct 15, 2025

This PR is recreated from carp-dk/flutter-plugins#1241, and there are some adjustment to inline documentations.

writeHealthData and writeWorkoutData is now returns String? uuid using InsertRecordsResponse.recordIdsList.firstOrNull() on Android and HKObject.uuid.uuidString on iOS. Please note that there is no extra efforts added when writing health data.

This is useful for some apps that need to utilise uuid once successfully writing health data (e.g. store into database for future use).

- 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
@kvenn
Copy link

kvenn commented Nov 3, 2025

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).

@nooralibutt
Copy link

@agilst can you please prioritize this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants