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

getDailyStepCountSamples return empty array as getStepCount return object of stepcount #141

Open
aanom opened this issue Jan 21, 2020 · 0 comments

Comments

@aanom
Copy link

aanom commented Jan 21, 2020

GETTING EMPTY ARRAY ( [] ) by calling getDailyStepCountSamples function

timestamp would be 3-4 hrs before the current time,

let options = {
startDate: (new Date(timestamp*1000)).toISOString(), // required
endDate: (new Date()).toISOString() // optional; default now
};

AppleHealthKit.getDailyStepCountSamples(options, async (err, results) => {
if (err) {
console.log('getStepCount err>>', err);
return;
}
console.log('getStepCount>>', results); ------------------------------> return empty array=>[]
}

As,

let options = {
date: (new Date(timestamp*1000)).toISOString(),
};
AppleHealthKit.getStepCount(options: Object, (err: Object, steps: Object) => {
if(err){
return err;
}

console.log('getStepCount>>', steps); ------------------------------> return step object with value and endDate
});

@aanom aanom changed the title getDailyStepCountSamples return empty array as getStepCount return data of same timestamp getDailyStepCountSamples return empty array as getStepCount return object of stepcount Jan 21, 2020
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