react-native-google-fit icon indicating copy to clipboard operation
react-native-google-fit copied to clipboard

GoogleFit.getXXXSamples(options) returns with no data

Open edvardmk opened this issue 2 years ago • 1 comments

Hi, as some people reported in earlier issues, there are specific circumstances in which some of the get_XXX_Samples(options) methods return without data. I tested different setups and could narrow down the error to the following in my case:

The method fails silently returning an empty array after a runtime for about 1 minute, if the interval between startDate and endDate of the options object is bigger than ~7,3 years.

In case endDate is not provided, it will be set to now, e.g. new Date() and the same problems occurred. These are the max intervals I could determine for some of the functions: getActivitySamples 2637 days getBloodPressureSamples 2672 days getDailyNutritionSamples 2678 days getDailyStepCountSamples fails/works inconsistently, but roughly around 2637 days getWeightSamples 2686 days

getBloodGlucoseSamples and getHeightSamples don't seem to have an issue with huge intervals and I didn't test the other methods.

I hope this helps hunt down the bug and in the meantime helps others working around this issue. Also thanks for the great work so far on this library!

edvardmk avatar Dec 26 '22 11:12 edvardmk

https://github.com/StasDoskalenko/react-native-google-fit/issues/207#issuecomment-1144004248 does this help?

shmkane avatar Feb 21 '24 17:02 shmkane