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

getDailyDistanceWalkingRunningSamples and getDistanceWalkingRunning are giving opposite results. #405

Open
kuldip-simform opened this issue Jan 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@kuldip-simform
Copy link

Describe the bug
getDailyDistanceWalkingRunningSamples and getDistanceWalkingRunning are giving opposite results.

getDailyDistanceWalkingRunningSamples response:

[
  {
    "endDate": "2025-01-10T10:00:00.000+0530",
    "metadata": [
      [
        Object
      ]
    ],
    "startDate": "2025-01-10T09:00:00.000+0530",
    "value": 129.01000000003842
  },
  {
    "endDate": "2025-01-10T13:00:00.000+0530",
    "metadata": [
      [
        Object
      ]
    ],
    "startDate": "2025-01-10T12:00:00.000+0530",
    "value": 10
  }
]

getDistanceWalkingRunning response

{
  "endDate": "2025-01-10T12:27:00.000+0530",
  "startDate": "2025-01-10T09:20:47.349+0530",
  "value": 139.01000000003842
}

To Reproduce
Steps to reproduce the behavior:

call this function

const getHealthData = () => {
    let options = {
      startDate: new Date(2025, 0, 10).toISOString(),
      endDate: new Date(2025, 0, 11).toISOString(),
      ascending: true,
      includeManuallyAdded: true
    };

    AppleHealthKit.getDailyDistanceWalkingRunningSamples(options, (err, results) => {
      if (err) {
        console.log('Error getting daily distance walking/running: ', err);
        return;
      }
      console.log('Results of getting daily distance walking/running: ', results);
    });

    AppleHealthKit.getDistanceWalkingRunning(options, (err, results) => {
      if (err) {
        console.log('Error getting distance walking/running: ', err);
        return;
      }
      console.log('Results of getting distance walking/running: ', results);
    });
  };

Expected behavior
getDailyDistanceWalkingRunningSamples should give a consolidated result, and getDistanceWalkingRunning should give an array.

Smartphone (please complete the following information):

  • Device: iPhone 13 mini, but reproducible in every device
  • OS: iOS 18.2
@kuldip-simform kuldip-simform added the bug Something isn't working label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant