Hi,
I'm an experienced iOS developer but new to Fitbit. I'm trying to understand what's available as far as iOS development, in particular with regard to the smartwatch.
I read through the developer information, but I'm not sure I fully understand it. It looks to me like there is a way to write apps that reside on the Fitbit in JavaScript, but I want to write an iOS app that communicates with the Fitbit and retrieves information such as heart rate.
Can this be done, and if so, how? Is the Bluetooth protocol documented somewhere? If not, is there a dedicated SDK for iOS, or some other way I could do this?
I read a little bit about "companion apps" which seem to be JavaScript modules that reside inside of the Fitbit app. This is definitely not what I need. I need to write a full-fledged iOS app.
If I need to write an app that resides on the Fitbit that communicates with my iOS app, that would be OK. That these apps can only be written in JavaScript seems less than ideal, as this is not a language I know, but I could probably find someone to help me with it. Assuming this is the only viable approach, can someone explain what communications options exist in the JavaScript language? Can JavaScript code use bluetooth, sockets, etc?
Thanks,
Frank
Answered! Go to the Best Answer.
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.
Unfortunately we don't have any native iOS integration or APIs available.
Currently the only way to communicate with the device is via the Companion API. Within a companion, you are able to use fetch and web sockets.
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.
Unfortunately we don't have any native iOS integration or APIs available.
Currently the only way to communicate with the device is via the Companion API. Within a companion, you are able to use fetch and web sockets.
My understanding is the communication is always proxied through the Fitbit app itself - so, while the communications must be proxied through a companion app, one to do this (and the only one available to do this, since there's no native integration) is provided out of the box. I don't believe the Ionic can reach out directly to the internet from the watch alone, though it does have wifi on-board - so it could *theoretically* be made to work that way in the future if Fitbit saw value in doing so..
It depends how quickly you want the data, and where. If you only want it on the device, you don't need a companion.
If you're happy to wait until the device has synced, you can get it via the web API (so no companion required).
Best AnswerOk... I see... So if I want to have the data live... (I have an iOS App that does GPS-tracking), I need a companion app?
Best AnswerYep. The hard part is getting it out of the companion app, since it can't store the data anywhere accessible directly into iOS.
Best AnswerThank you very much for your help.
So... using the Fitbit like I'd use a heart-rate chest strap does not work? Where I'd simply connect to it and get just live data. The iOS app would then deal with storing that data?!?
So if I'd need to build an Fitbit App. It would basically be something the user has to start manually in order to get data to the iOS companion app?
I don't even have a Fitbit yet, I am just looking into whether it would make sense to get one and add support for my app.
Best AnswerIt's possible to get the companion to run without user intervention, but you won't get real-time data. Fitbit comms are slow and have to be batched for best reliability.
You'll still need to consider how to get data from the Fitbit companion app to your iOS app. Your only options are fetch() or WebSockets from the companion, so your iOS app is either going to need to include a server, or to access the server to which you send the data.
Best AnswerHi,
I am also trying to achieve the same. I successfully created client - server architecture on android but I am getting issues with ios. We have already used BlueSocket and SwiftSocket.
Did you get any success on iOS side. If yes, can you help us with the library or code. I am open to share the code i currently used if required.
Thanks in advance.
Best Answer