6

So I'm trying to build an iOS app (Swift 2) which integrates FitBit.

Once the user open the 'Walks' page, the user should be able to see his daily number of steps.

Ideally, we do not want every user to register to FitBit.

So I'm trying to figure out if there is a way to fetch the data from your Fitbit directly, rather than calling the Fitbit API every time. I only require the number of steps walked daily.

TIA!

Vishal
  • 887
  • 9
  • 22
  • hey can you please share your code with me ? because i also want to integrate fitbit API with my Swift app but i do not understand how to di it – Umair Afzal May 30 '16 at 06:31

2 Answers2

3

Currently there is only one way to fetch data from FitBit, Oauth 2.0 API. There is no other way. So it is not possible to fetch FitBit data without SignIn. If you want to integrate FITBIT OAUTH 2.0 API, Follow step by step FITBIT tutorial https://appengineer.in/2016/04/30/fitbit-aouth-in-ios-app/

Mahendra Y
  • 1,941
  • 20
  • 26
2

The short answer seems to be: No.

"The Fitbit API" is an HTTP OAuth rest api, which allows your server (or http-client) to exchange data with the Fitbit servers.

To the best of my knowledge there is no other API or official way to get to this data. Also fitbit does not currently write to the HealthKit Api, so it is not possible to get step data that way. According to this article:

https://gigaom.com/2014/12/24/how-to-use-a-fitbit-with-apple-health/

there should be some workaround, but I have not tried this trick, and it might have other disadvantages and require your users to install other apps on their phones. I imagine that the dataexchange between the fitbit and the phone through bluetooth would be encrypted but that is purely speculation on my side :-)

We have chosen to use the official fitbit Api which has excellent documentation and is rock-solid. Good luck in your endeavors!

karstenols
  • 277
  • 2
  • 9
  • 1
    Hey thanks for answering @karstenols. I had decided to go ahead with the Official API's. I let the user open the Fitbit app initially, which then sync with their Fitbit. On loading back the app, I call the API and fetch my results. – Vishal Feb 01 '16 at 17:03
  • So as of now is there no way to get data directly from Fitbit device or Fitbit app? Because Fitbit API will only work if data is synced onto their servers. – Nikhil Manapure Nov 14 '16 at 13:50