dariosalvi78 / cordova-plugin-health

Cordova plugin for the HealthKit and Google Fit frameworks
MIT License
174 stars 126 forks source link

Add support for the Recording API which is part of the new Fitness API - For Android #197

Open cooliscool opened 3 years ago

cooliscool commented 3 years ago

With the Recording API - which is part of new Fitness API, it's now possible for the App to request automated storage of sensor data in a battery- efficient manner by creating subscriptions. That means if the app is built focusing on certain fitness variables, then subscribing to Recording API helps to make sure those params are either captured using sensors OR is fetched from the Google Fitness store and cached locally on the device whenever internet is available which is a grreat advantage.

For example, take a scenario where a user has disabled fitness data collection on Google Fit App. In that case any steps wouldn't be updated. Here, using recording API, our App can request collection of steps data on behalf of the user.

Read more on this https://developers.google.com/fit/android/record.

I am not sure if any similar feature is available for iOS. I would like to know maintainers' thoughts on this feature. Is there someone else working on this ? I have done some.

dariosalvi78 commented 3 years ago

thanks for the suggestion.

I believe this API is meant to be used by apps that require tracking should be guaranteed over specific periods, for example a cycling app that wants to track localisation with higher precision during a workout. I have never planned to integrate this API because a) I wouldn't use it for my apps and b) it has no equivalent in HealthKit that I know of.

That said, if anybody is interested in exposing thisAPI through the plugin, I would be happy to consider a Pull Request.