Forum Posts

Resolved! Text new line issue

in my index.js file I have made a reference to my text in my index.view, SpeechBox, and I'm trying to change the text of the element with the JavaScript, SpeechBox.text = "some text" and I'm trying to use the new line, \n, but whenever I do it shows ...

Accelerometer app crashing during the night

I have a an app that needs to :- read accelerometer data at 50Hz.- aggregate 1minute of these readings- verify if the sum of the standard deviations of x,y,and z is larger than a threshold.     - if yes, write the aggregated data into a file    - if ...

Irregular heartbeat (afib) notification via Web API

Hi,We're planning to develop a physician notification/intervention module into our healthcare platform where we want to physicians to be automatically notified if irregular heartbeats are detected on a consenting patient. Physicians could be recommen...

Issue Connecting Fitbit to Firebase

Hi, I'm trying to develop an app that takes user input on the watch and then sends that information to the companion app which would then be sent to a database on firestore. The app etc works fine, its the connection to firestore that's the issue.  D...

erorggy by Jogger
  • 850 Views
  • 3 replies
  • 2 votes

Clock face logic disappearing when using Apps

I'm developing a clock face that has items appear on screen daily (i.e. text, button, event listeners), disappear at night, and reappear the next morning & so on. I'm running into an issue where if an App is opened/run (Exercise), accidentally or oth...

dbe5007 by Recovery Runner
  • 572 Views
  • 7 replies
  • 0 votes

Resolved! Multi-view clockface mounting duplicates of other view

I'm developing an watch face with 2 views - a main clockface view and alternate view that sometimes appears. After some testing I've noticed when I move back and forth between the alternate view that its double or triple mounting the alternate, resul...

dbe5007 by Recovery Runner
  • 754 Views
  • 4 replies
  • 0 votes

Resolved! Button Debounce?

I'm looking for a way, if possible, to debounce a button once it has been pressed. I'm developing a watchface (Versa 3) with a central button that, when pressed, fades away for 5 seconds and then reappears. However during that fade away a user could ...

dbe5007 by Recovery Runner
  • 749 Views
  • 7 replies
  • 5 votes

Resolved! Localisation

Is toLocaleString() supported? I got the current locale from user-settings with locale.language and I tried to localise the date with toLocaleString(), but it didn't work. How is the date localised in the Fitbit-watchfaces?

Resolved! Battery Level Bar - Not working on watch, only Simulator

I am having an issue with coding working while in the simulator, but once I load the watchface to my Versa 3, the part of the watchface that I have coded to change images based on battery level, not only doesn't work, none of the images even show up....

Chamcham_0-1663967694767.png
Chamcham by Recovery Runner
  • 393 Views
  • 7 replies
  • 1 votes

User Preference on Settings page

I'm working on a ClockFace that also comes with settings page on the phone. The challenge that I'm currently experiencing is on how to get user preferences on the actual settings page? Indeed, I can read user preferences on the device by importing 'u...

Resolved! Multi-View feature in SDK 5

I'm trying to create a watch app that integrates the multi-view feature. I've been through the documentation and the multi-view sample app on github, but I can't seem to find information for the current SDK version. Could anyone please share any SDK ...

dbe5007 by Recovery Runner
  • 410 Views
  • 1 replies
  • 1 votes

Resolved! External pojo in OS 6+

Hello,I am finally getting around to update my grade app for the newer OSs. I am stuck because I use a Pojo not in index.js, and when I try to construct a class of it, I get the following error. TypeError: Cannot create property 'code' on boolean 'tr...

Resolved! Limit decimal number precision

Hello, I would like to limit a decimal number, with a number of decimal digits preset by me (2 would be fine), there is a funcion to do this?  

Gian01 by Base Runner
  • 723 Views
  • 6 replies
  • 1 votes

How to properly structure views?

What is the best way to structure views so that you can access elements from a few before you see it on the screen? I have views structure hierarchically, where an onclick event for a button assigns the next view. Example:let button1 = document.getEl...

M.H by Recovery Runner
  • 516 Views
  • 4 replies
  • 0 votes

Launch a timer of the `Timers` app directly.

Can I launch a timer of the `Timers` app directly? When I say Alexa "Set timer to 3 minutes", the `Timers` app will launch and the countdown will start immediately. I want to same thing from my app. I know `launchApp` function that is launches an app...

tatesuke by Recovery Runner
  • 382 Views
  • 0 replies
  • 1 votes

Resolved! Date formats

Are any date formatting features available in the SDK JavaScript? EG.date.toLocaleString('fr-FR', options)or are there routines to emulate this ?

Guy_ by Space Racer
  • 679 Views
  • 6 replies
  • 5 votes

How to do this with fetch()??

Hello,I want to do a http request to a website which says i should do it like following:POST /automate/cloud/message HTTP/1.1 Host: llamalab.com Content-Type: application/x-www-form-urlencoded secret=&to=&device=&priority=normal&payload=Hello%20Worl...

Does HeartRateSensor frequency do anything?

It looks like using the frequency option for HeartRateSensor doesn't do anything. No matter if I set the frequency 5 or 0.5, the onreading callback called once in every second using my Versa 3 (with SDK 6.1). In the simulator it's called on every cha...

HeyJ0e by Jogger
  • 360 Views
  • 4 replies
  • 0 votes

Resolved! array.includes()

Just got a message: Unhandled exception: TypeError: Expected a function.on: if ( !bestandenlijst.includes(file) ) doThis();file="2.png"bestandenlijst = ["1.png","2.png", "3.png","4.png","5.png"] Doesnt fitbit understand the function includes()https:/...

Resolved! Memory issue

I have reached the memory limit in my watchface and am investigating the causes.I noticed that the call document.getElementById, without other invocation on the returned svg element, produce memory load that will not be recovered by garbage collector...

peersocket onmessage suddenly doesn't work

Hello I have programmed my own watchface with a weather display. Until today everything has worked. I just wanted to add more icons and so I changed the icon codes. Suddenly I don't get into the message-event in the app.js of the companion after send...

Watch Face Eats Battery Like Crazy

The source code I've developed on GitHubThe code works beautifully in the simulator but naturally the real thing has a couple pretty serious problems that maybe you could help me with. The two major issues are: 1 ) This watch face eats the battery li...

iPh33r by Base Runner
  • 480 Views
  • 4 replies
  • 2 votes

Resolved! Programatically fire tick event

Hey,I'm currently creating yet another clock and I need to show the current time in a label based on a toggle in my settings page.Sounds easy but my clock granularity is set to minutes so my user would have to wait up to ~59 seconds to see the change...

wrnr by Jogger
  • 431 Views
  • 2 replies
  • 5 votes

Randomizing Images for watch face

I want to create a watch face that displays the basic information such as time, date, steps, battery and cardio with a image in the center that changes to different images. Hopefully I could set it up to change the images to each time the watch wakes...

Step 4 exchange auth code for access and refresh token

I keep receiving an error with my fit bit request specified in step 4 of the authorization guide. I get userCode from the call back url. const sendJson = {                "method": "POST",                headers: {                    Authorization: '...

NiLM by Jogger
  • 332 Views
  • 0 replies
  • 0 votes

Resolved! Who optimizes the Javascript source code?

I wrote below codes:// app/mymodule.ts const a = 0; let unuseVariable = 1; const unuseConst = 2; export const c = a; export class UnuseClass { someMethod() { return unuseConst } }// app/index.ts import {c} from "./mymodule" conso...

tatesuke by Recovery Runner
  • 572 Views
  • 2 replies
  • 1 votes

Settings template app

Hithe "settings" template at https://studio.fitbit.com/projects/createIt doesn't seem to do much, the screen on my watch goes white but I was expecting something like my companion phone being able to control the watch colour. I think I am missing som...

tonyf1 by Recovery Runner
  • 403 Views
  • 3 replies
  • 1 votes

How to rotate between stats on click?

Hi, I want to rotate stats on one of my clock faces when the user clicks on the display. So far I have tried the "#cycleview-item", it worked fine until I wanted to put images with the stats (It doesn't work with images). I've read through the docume...

4463 by Recovery Runner
  • 444 Views
  • 1 replies
  • 0 votes

Stats refresh interval

Hello, Hope all is well.  Right now I have my clock face running.  However, the steps don’t update in real-time on my clock face.  What’s the best way to write the JS to update these stats in real-time?  Thanks in advance!

ramirezp by Recovery Runner
  • 2235 Views
  • 7 replies
  • 3 votes

Resolved! How does multiple position updates behave?

SDK:5.0.2Device: Fitbit Versa3(36.128.5.38) What does it do internally when I write code like below? SpoileraGraphicsElement.x = 10;if (foo) {  aGraphicsElement.x += 10;}aGraphicsElement.x = 10;if (foo) {  aGraphicsElement.x += 10;}When foo is true, ...

tatesuke by Recovery Runner
  • 360 Views
  • 2 replies
  • 2 votes

Changing the app background via javascript

Hi all,I'm new to Fitbit Versa and I'm trying to change the background color of a simple app when different events occur - for example when the device is removed from the wrist, turn the background color "fb-orange".Are there any examples of this? Th...

Error when i import every module

Issue extended from this [https://community.fitbit.com/t5/SDK-Development/Import-external-module/m-p/4178893#M11671]I'm still using the sdk-cli to use the module but when i try to import a module it return me the same error ( Cannot find module '{mod...

MarcS7 by Recovery Runner
  • 1001 Views
  • 4 replies
  • 2 votes