12-29-2018 09:37
12-29-2018 09:37
I just got my first Fitbit last week for Christmas and I am creating my very first watch face, I have gotten a background to work, a battery meter, steps and heart rate working, at least with the simulator. I still want to **ahem** the floors climbed stat and I am having some issues. Does anyone know of a clean simple example that I can look at code and learn from it. I see plenty of examples but having a difficult time following the code. Thanks in advance
12-29-2018 10:13
12-29-2018 10:13
First, make sure that you have the "access_activity" permission enabled on your app.
Here is example code that gets the number of floors climbed today:
import { today } from "user-activity"; console.log(today.local.elevationGain);
From there, you can add the elevationGain to the display on your watch face.