cph-cachet / flutter-plugins

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

[Health]: Remove Google Fit support #1014

Closed SlimShadyIAm closed 3 months ago

SlimShadyIAm commented 3 months ago

Google will soon be turning down support for Google Fit in favor of Google Health Connect in the coming months, and as such we have previously planned to remove support for it in the health plugin.

This PR includes also includes a cleanup of the Android code and updates to the documentation.

Changelog

bardram commented 3 months ago

Remember to add entry to CHANGELOG and bump version before publishing.

bardram commented 3 months ago

When testing on iOS and pressing "Add Data" the app throws an uncaught exception:

*** Terminating app due to uncaught exception '_HKObjectValidationFailureException', reason: 'HKDiscreteQuantitySample 28D6521E-928C-4889-A5A8-C7A4F7B5699D 30 ms  (2024-08-21 16:10:24 +0200 - 2024-08-21 16:30:24 +0200) requires unit of type Mass. Incompatible unit: ms'
SlimShadyIAm commented 3 months ago

When testing on iOS and pressing "Add Data" the app throws an uncaught exception:

*** Terminating app due to uncaught exception '_HKObjectValidationFailureException', reason: 'HKDiscreteQuantitySample 28D6521E-928C-4889-A5A8-C7A4F7B5699D 30 ms  (2024-08-21 16:10:24 +0200 - 2024-08-21 16:30:24 +0200) requires unit of type Mass. Incompatible unit: ms'

Fixed - when writing health datapoints, we weren't checking if the data type is available on the platform. The example app was trying to write Android-exclusive data.