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

Advice: Implement queues for device communication

Because my app suddenly and inexplicably stopped working, I dusted off the Fitbit SDK and tried to fix it. While I was dismayed that so little has changed* I did find something that I wanted to share with others that perhaps encountered this.

 

I noticed that my Companion app was receiving each message in triplicate even though the Watch app only sent it once. This triggered a whole chain reaction of actions and responses that didn't happen on the Simulator. Maybe it's just my device that is faulty, but I still implemented a message queue to make sure each request was handled in order and any duplicate requests were discarded.

 

Then a host of my app's problems disappeared.

 

 

* <rant> disconnects are still happening all the time, installs only working on the second attempt, and the Simulator still poorly supported on Linux, especially when making HTTPS requests, TypeScript support still seems a bit dodgy. There are no insights in how well your app is doing and the app gallery is in a sorry state. I hope Fitbit will work on making all of this a bit better. A strong community builds a great product. </rant>

Best Answer
0 Votes
2 REPLIES 2

That's weird. I don't think I've seen anyone with multiple messages. Are you only seeing this behavior in the simulator? Is the project exported somewhere?

 

There's decent message queue package here https://www.npmjs.com/package/fitbit-asap

 

The simulator isn't supported on Linux.

 

There's a great TypeScript package here: https://github.com/SergioMorchon/fitbit-sdk-types/

 

There still aren't developer stats available, but there is a Google Analytics package: https://github.com/dillpixel/fitbit-google-analytics

 

Best Answer
0 Votes

Like I said, it might be my hardware that's faulty. I basically ended up implementing a very barebones version of that package you gave, but thanks for sharing. That will come handy if I do any future development (if proper Linux support or direct sideloading happens one day). The project is the K R A K E N (forbidden word..) app on your marketplace.

 

I used the TypeScript package but it constantly balks at thinks like the console and other built-in fitbit classes not being found.

 

For developer stats, I'd hate to implement privacy-invading software in a low-power environment. The marketplace would be the best place to do that.

Best Answer
0 Votes