cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
551 stars 681 forks source link

[Health] Add UUID to HealthDataPoint #1013

Closed DusanMicuda closed 2 months ago

DusanMicuda commented 3 months ago

Could you please add uuid property to HealthDataPoint ? The Health Connect provides [unique id](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata#id()) of the data. It could be useful for saving this data to database on remote server.

SlimShadyIAm commented 3 months ago

Thanks for your suggestion, I will look into this and open a PR for it soon.

SlimShadyIAm commented 3 months ago

@DusanMicuda I'd appreciate if you could help test the PR I made above!

DusanMicuda commented 3 months ago

I appreciate your work, but I think that it would make sense, if you could implement the ios side as well. There you can use HKObject.uuid

SlimShadyIAm commented 3 months ago

Actually, it seems like the the iOS side was already implemented (e.g https://github.com/cph-cachet/flutter-plugins/blob/12a069b07d7659846acc525daae28827c16e7c86/packages/health/ios/Classes/SwiftHealthPlugin.swift#L823), it just wasn't read by our parsing code in Flutter.

But if you do test on iOS as well, could you check that you do get the UUIDs where you would expect?

DusanMicuda commented 3 months ago

Sorry, I didn't notice that. I'll check it.

DusanMicuda commented 3 months ago

Alright, I tested it. Looks like it works well for me 😁 Thank you so much 😊

SlimShadyIAm commented 3 months ago

Wonderful. It will be included in the next major release which I hope is in the next couple of weeks.