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

Getting Inaccurate data for steps via getStatisticsCollection in v2 #42

Open
Rahul-codoffer opened this issue Oct 13, 2024 · 2 comments

Comments

@Rahul-codoffer
Copy link

Rahul-codoffer commented Oct 13, 2024

Getting inaccurate step count form getStatisticsCollection method via v2

let startDate = "2024-10-07T00:00:00.000Z";
let endDate = "2024-10-07T23:59:59.000Z";
let anchorDate = "2024-10-07T00:00:00.000Z";
      
await CapacitorHealthkit.getStatisticsCollection({
        startDate,
        endDate,
        interval: {
          unit: 'day',
          value: 1
        },
        anchorDate,
        quantityTypeSampleName: 'stepCount',
      }).then(async (res: any) => {
        console.log("health data step", res);
      });
      
Received response - [ {
            "value": 12252,
           "startDate": "2024-10-07T00:00:00Z",
           "endDate": "2024-10-08T00:00:00Z"
       }]

But there is total 13,121 steps in my apple health

IMG_1328

``

@Rahul-codoffer
Copy link
Author

i have fetched health data for the last one week and you can see the response its not accurate


     "data": [
        {
            "startDate": "2024-10-07T00:00:00Z",
            "value": 12252,
            "endDate": "2024-10-08T00:00:00Z"
        },
        {
            "endDate": "2024-10-09T00:00:00Z",
            "startDate": "2024-10-08T00:00:00Z",
            "value": 13917
        },
        {
            "startDate": "2024-10-09T00:00:00Z",
            "endDate": "2024-10-10T00:00:00Z",
            "value": 8855
        },
        {
            "startDate": "2024-10-10T00:00:00Z",
            "value": 6166,
            "endDate": "2024-10-11T00:00:00Z"
        },
        {
            "value": 6090,
            "endDate": "2024-10-12T00:00:00Z",
            "startDate": "2024-10-11T00:00:00Z"
        },
        {
            "endDate": "2024-10-13T00:00:00Z",
            "startDate": "2024-10-12T00:00:00Z",
            "value": 10423
        },
        {
            "value": 7022,
            "endDate": "2024-10-14T00:00:00Z",
            "startDate": "2024-10-13T00:00:00Z"
        },
        {
            "startDate": "2024-10-14T00:00:00Z",
            "endDate": "2024-10-15T00:00:00Z",
            "value": 555
        }
    ]

IMG_1334

@Rahul-codoffer
Copy link
Author

@mahnuh may be it is issue of time zone ? 
my current time zone is IST

@Rahul-codoffer Rahul-codoffer changed the title Getting in accurate data for steps via getStatisticsCollection in v2 Getting Inaccurate data for steps via getStatisticsCollection in v2 Nov 5, 2024
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

1 participant