07-12-2021 18:50
07-12-2021 18:50
I've been trying to use the documentation to get averageHeartRate to return something other than undefined. I have seen from previous post of this same issue but doesn't look like any show a true resolve? Is this something that just doesn't work? Any other variable I can get to return a value expect for AHR.
if (appbit.permissions.granted("access_activity")) {
const dayRecords = dayHistory.query({limit:7});
dayRecords.forEach((day, index) => {
console.log(`${day.distance || 0} distance. ${index} day(s) ago.`);
console.log(`${day.steps || 0} steps. ${index} day(s) ago.`);
console.log(`${day.calories || 0} calories. ${index} day(s) ago.`);
console.log(`${day.averageHeartRate} averageHeartRate. ${index} day(s) ago.`);
console.log(`${day.restingHeartRate} restingHeartRate. ${index} day(s) ago.`);
});
I've tried this on device and simulator both show the same in the logs. I've tried a range of days from 1-14 and still the same.
Thoughts?
07-12-2021 18:55
07-12-2021 18:55
Got the access_heart_rate permission?