02-08-2020 01:50
02-08-2020 01:50
Hi, I am using dayHistory on a clock face. After doing a factory reset of my Ionic, it reports bizarre stats for days before the factory reset:
Calories: 499118149
Distance: 0
Steps: undefined
Floors: 6553
To demo the issue I did a factory reset yesterday and then ran this code today:
import { dayHistory } from "user-activity";
DemoIssue();
function DemoIssue() {
var daysToRetrieve = 4;
for (var i = 0; i < daysToRetrieve; i++) {
console.log("Calories " + (i+1) + " day(s) ago: " + dayHistory.query()[i].calories);
console.log("Distance " + (i+1) + " day(s) ago: " + dayHistory.query()[i].distance);
console.log("Steps " + (i+1) + " day(s) ago: " + dayHistory.query()[i].steps);
console.log("Floors " + (i+1) + " day(s) ago: " + dayHistory.query()[i].floors);
}
}
Which produced this output:
[9:44:36 AM]Calories 1 day(s) ago: 2524
[9:44:36 AM]Distance 1 day(s) ago: 4641
[9:44:36 AM]Steps 1 day(s) ago: 6322
[9:44:36 AM]Floors 1 day(s) ago: 14
[9:44:36 AM]Calories 2 day(s) ago: 499118149
[9:44:36 AM]Distance 2 day(s) ago: 0
[9:44:36 AM]Steps 2 day(s) ago: undefined
[9:44:36 AM]Floors 2 day(s) ago: 6553
[9:44:36 AM]Calories 3 day(s) ago: 499118149
[9:44:36 AM]Distance 3 day(s) ago: 0
[9:44:36 AM]Steps 3 day(s) ago: undefined
[9:44:36 AM]Floors 3 day(s) ago: 6553
[9:44:36 AM]Calories 4 day(s) ago: 499118149
[9:44:36 AM]Distance 4 day(s) ago: 0
[9:44:37 AM]Steps 4 day(s) ago: undefined
[9:44:37 AM]Floors 4 day(s) ago: 6553
Is there any way to get the device to report the correct data after a factory reset?
Thanks,
Howard
Best Answer02-11-2020 14:57
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
02-11-2020 14:57
That's a new one on me. I'll log this for the firmware team, but I assume it will correct itself as new data is stored on the device.
Best Answer