Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change clock face based on dynamic data from React Native

Hi everyone,
Is it possible to create a react native app that connects to a Fitbit device (I use Versa 3) and change the clock face based on data input from the app?
If possible, how can I do that? Is any SDK that I can use?
I know there is Web API, but I didn't see any docs that explain to change the clock face if using Web API.

Best Answer
0 Votes
1 REPLY 1

I don't know about the react side of it, but from the Fitbit side, it's possible. Your app would need to communicate with a companion component of your clockface, which would then forward the data to the clockface itself.

The companion could only communicate with your app via fetch() or WebSocket. The companion works like a client, so it could send fetch() requests to your react app, which would need to send responses like a server. This might mean that the companion would need to periodically poll react for data changes. WebSockets can be bidirectional which may alleviate that issue.

Keeping the companion running and communicating for long periods could be a problem. It can be programmed to wake every five minutes, which may help.

Security could also be a complication. https or wss (not self-signed) is preferable; otherwise there are constraints on which IPs you can use (and this seems to vary between iOS and Android).

Peter McLennan
Gondwana Software
Best Answer
0 Votes