09-14-2017 06:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-14-2017 06:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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.
Accepted Solutions
09-14-2017 07:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


09-14-2017 07:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
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.
09-14-2017 07:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


09-14-2017 07:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
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.
09-14-2017 07:30
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-14-2017 07:30
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Can apps running on the device use websockets and fetch to communicate directly with servers on the internet, or must they proxy the communications through a companion app?
09-18-2017 08:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-18-2017 08:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
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..
08-21-2019 02:32
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-21-2019 02:32
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hey Jon,
is this still true? So when I want to read heartrate data I still need a companion app?

08-21-2019 02:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-21-2019 02:45
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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).
Gondwana Software

08-21-2019 02:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-21-2019 02:47
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Ok... 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?

08-21-2019 02:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-21-2019 02:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Yep. The hard part is getting it out of the companion app, since it can't store the data anywhere accessible directly into iOS.
Gondwana Software

08-21-2019 03:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-21-2019 03:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thank 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.

08-21-2019 13:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-21-2019 13:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
It'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.
Gondwana Software

09-27-2019 04:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-27-2019 04:35
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi,
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.

