How to Integrate Fitbit API in iOS App Using Swift

How to integrate FitBit Api in IOS app using Swift

FitBit work with OAuth 2.0 API which require Client ID and Secret key. You need these client id and secret key to authenticate with OAuth 2.0 API.
There is a blog post related to FitBit integration in iOS with Swift.
Lets checkout and learn "How to implement fitbit in iOS"
https://appengineer.in/2016/04/30/fitbit-aouth-in-ios-app/

ex:

let oauthswift = OAuth2Swift(
consumerKey: fitbit_clientID,
consumerSecret: fitbit_consumer_secret,
authorizeUrl: "https://www.fitbit.com/oauth2/authorize",
accessTokenUrl: "https://api.fitbit.com/oauth2/token",
responseType: "token"
)

Setting up Fitbit api in xcode Swift

It may be helpful for you-

Sample Image

You can use callback url as https://www.google.com/ for testing purpose.
If you are designing app for a particular Organisation than put that organisation url - Example-
http://www.fortishealthcare.com

FitBit Integration

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!

FitBit API integration IOS

Yes. Check the fitbit api docs, there is a clearly marked attribute called startTime.

How to do Access Token Request in Fitbit API Integration - iOS?

Instead of NSURLSession use NSURLConnection to request data from Fitbit APIs.

Fitbit API: Not returning the steps for a time range on a date

I found the reason behind Fitbit returning such data. It is just because the intraday data fetch requires the review from Fitbit or we can use the "personal" application type to get the data.



Related Topics



Leave a reply



Submit