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

Fitbit SDK for iOS?

ANSWERED

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

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

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.

View best answer in original post

Best Answer
10 REPLIES 10

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.

Best Answer
Thanks for the reply.

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?
Best Answer

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..

Best Answer

Hey Jon,

is this still true? So when I want to read heartrate data I still need a companion app?

Best Answer
0 Votes

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).

Peter McLennan
Gondwana Software
Best Answer
0 Votes

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?

Best Answer
0 Votes

Yep. The hard part is getting it out of the companion app, since it can't store the data anywhere accessible directly into iOS.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

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.

Best Answer
0 Votes

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.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

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.

Best Answer
0 Votes