-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for non-String fields in metadata like HKMetadataKeySyncVersion #17
Comments
Hi, following up to see if the problem description is clear. There are more details in kvs-coder/health_kit_reporter#46 - it reads like a debug log, but I'm happy to clarify any details you'd like. In the meantime, is there is a workaround to write HKMetadataKeySyncVersion to apple health in quantity samples ? |
Hi, just checking in: were you able to look at this bug ? @VictorKachalov |
Hi @umangsh Thank you for your message. Unfortunately I didn't yet have time to take a look at the issue. Have you tried to provide any local fixes? If so It could be a good opportunity to open a PR, if not I will try this week |
Thanks! My local fixes didn't work unfortunately. |
@VictorKachalov were you able to look at this bug last week? |
@VictorKachalov checking in, any luck with this bug? |
Hi @umangsh Please sorry for my late response, unfortunately couldn't make it for the deeper investigation due to the lack of time last months. The original HK metadata expects one of the three possible types: I am seeking the possibility to bring a clean solution combining these types in one metadata property, but currently don't have any ideas. As a fallback solution, I could extend the amount of metadata properties like:
|
@VictorKachalov Makes sense, thanks for the explanation. |
Hi @umangsh please check the latest 2.0.0 version (Metadata revamp potentially introduces breaking change, but I prepared a fallback solution to avoid errors because |
@VictorKachalov Awesome, thank you! |
@VictorKachalov Thanks! I was able to update the plugin version (2.1.0) and pod version (2.0.0) - I think it's improved, but doesn't work quite yet - HKMetadataKeySyncIdentifier and HKMetadataKeySyncVersion values aren't written to Apple Health.
Sample outputs:
|
@VictorKachalov was the previous message helpful? Let me know if I can provide any more info. |
hi @umangsh |
@VictorKachalov Just the two fields - HKMetadataKeySyncIdentifier and HKMetadataKeySyncVersion, other values are written fine. |
@kvs-coder still an issue. I wonder if Double and NSNumber are causing issues. Here's a small snippet to reproduce in flutter:
HKMetadataKeySyncVersion and HKMetadataKeySyncIdentifier are not written to apple health. These fields are required for de-duping: |
Is your feature request related to a problem? Please describe.
Harmonized.metadata uses [String: String] map for field representation. This fails for metadata fields like HKMetadataKeySyncVersion which expect an NSNumber. Presumably affects other NSNumber fields like HKMetadataKeyReferenceRangeLowerLimit, etc.
Describe the solution you'd like
Quantity.Harmonized.metadata should not fail when setting {'HKMetadataKeySyncVersion': 123} and writing to healthKit on device.
The text was updated successfully, but these errors were encountered: