Is there some way to actually save Heart Rate values?
I see that in the repo there is the Scopes.FITNESS_HEART_RATE_WRITE but I cannot find a way to actually write it.
How can I do it?
Also is it normal that saving a weight doesn't actually update the Google Fit (I get success)?
EDIT: The last issue was related to the fact that I was trying to update the Google Fit data from a different device (i.e. running the code on the emulator with my account but no GF app and seeing it updated on the GF app on another device). Is that even possible?
Fewer things can happen here. Data sync between devices. I believe in Samsung there is a manual way to sync my data without waiting, or block by user settings from device to Google (whatever the place google stores our data).
Another thing is for some of data, Google Fit App choose not to display it even though the Api does exist. Best thing you can do it to install both Apps in two devices to test the data consistency.
It's actually just the emulator of a Pixel device, so it's hard to say. But for example, if I write the fitness data while the Google Fit isn't installed and then the user installs it, will the old data be available on the app after the installation?
And back to the original question: what about writing heart rates? Is it possible or was it just forgotten from the library?
[Thanks for your response btw! 😃 ]
@Nesh108
For first question, I believe it's yes but I cannot 100% confirm. This lib is designed to be standalone without Google Fit App.
Data exists in your local device Google Fitness store, I cannot confirm when it will be sync to Google Fit online.
May or may not be sync depending on user setting. But Prod Apps may have their own database and just utilize the Google Fit Api to collect fitness data.
Writing heart rates. I don't think it exists. The current associated functions are implemented by other Devs in the past. It could be a feature in the future, but heart rate is a quite ambiguous term right now because Google Fit also used heart points. And it's associated with each activity. For some reasons I was not able to manually create it along with some specific Data Field for many activities from my own app, and they got recalculate and overwrite by the Google Fit app, which it's the reason why the workout PR got stuck for a while, but I guess I want to to release those experimental features no matter what. They did work well with simple activity like meditation.
How about this function: https://github.com/StasDoskalenko/react-native-google-fit/blob/fbcf2c70042150bdea86cced641a7e006eb37db5/android/src/main/java/com/reactnative/googlefit/HeartrateHistory.java#L97-L111
Isn't it possible to use that to save the user's BPM at a given time?
How about this function:
https://github.com/StasDoskalenko/react-native-google-fit/blob/fbcf2c70042150bdea86cced641a7e006eb37db5/android/src/main/java/com/reactnative/googlefit/HeartrateHistory.java#L97-L111
Isn't it possible to use that to save the user's BPM at a given time?
You are right. Not sure why it wasn't exposed out as a public function. I need to test it out in real device to check the real result. I I assume there are some variable type issues that cannot be applied directly.