Skip to content
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

getActivitySamples missing data #316

Open
zarahackaton opened this issue Aug 26, 2022 · 3 comments
Open

getActivitySamples missing data #316

zarahackaton opened this issue Aug 26, 2022 · 3 comments

Comments

@zarahackaton
Copy link

zarahackaton commented Aug 26, 2022

Hi guys, i'm trying to retrieve the steps count using getActivitySamples but for some reason I can't see some of the activities at all. But, once I add manual activity, I can see the specific activity with the steps count.
I tried to play around with bucketUnit and bucketInterval also but nothing, attaching code below:

const activities = await GoogleFit.getActivitySamples({
  startDate: "2022-08-25T00:00:00.000Z",
  endDate: new Date().toISOString(),
  bucketUnit: BucketUnit.SECOND,
  bucketInterval: 1,
});

Thanks.

@aboveyunhai
Copy link
Collaborator

aboveyunhai commented Aug 30, 2022

If you just want to get total steps by given time range, then getDailyStepCountSamples() shall give your the better approximation.
However, if you only care about the step inside the activity, then it's hard to tell, based on my own experience, Google Fit always gave your "weird" result depending on the activity. Even though you can insert activity with steps, if the activity itself doesn't support "step", it might give some weird data back when you use getDailyStepCountSamples(); For instance, you shall not expect "Yoga" activity gives you step data.

You can try out this one https://github.com/StasDoskalenko/react-native-google-fit#17-workout-experimental getWorkoutSession() to compare the step, just to check out the differences

@sharjeelaqdus1
Copy link

Hi @zarahackaton @aboveyunhai I am facing the same issue. I can see activities in google fit but unable to fetch into our app. Have you got any solution on this ?

@pavelbabenko
Copy link

pavelbabenko commented Oct 25, 2022

Same issue. The library doesn't return activities that are listed in Google Fit. However, steps from activities are returned in getDailySteps()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants