09-27-2018 05:33
09-27-2018 05:33
Hello all,
i`m new in js and have problems to integrate steps (right) and distance (middle) in my clockdesign for versa.
Zip-File: https://files.fm/u/x94zzmpd
Could somebody help me or build it for me 😞
Best Answer10-01-2018 09:42
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.
10-01-2018 09:42
You need to import the user activity module:
import { today } from "user-activity";
Put ID's on your text field labels, and get a handle on them in code:
let myStepsLabel = document.getElementById("myStepsLabel");
let myDistanceLabel = document.getElementById("myDistanceLabel");
Then update your text fields with these values inside the clock tick event:
myStepsLabel.text = today.adjusted.steps; myDistanceLabel.text = today.adjusted.distance;