FitBit AOuth in iOS app


The Fitbit API allows developers to interact with Fitbit data in their own applications, products and services. The API allows for most of the read and write methods that you will need to support your application. If you have uses or needs that are not currently supported by the API, drop by the Dev Forum and let us know! We look forward to working closely with the development community to make the Fitbit API a system that enables you to do awesome, mind blowing stuff.

You can fetch fitbit data in your health app , please follow following procedure.

  1. Resister your application in fit bit developer account https://dev.fitbit.com/apps/new
  1. Copy Client Id and consumer_secret , It will be used in your Application.
  2. Download FitBit-Auth-for-iOS from http://msyshani.github.io/FitBit-Auth-for-iOS/ Drag and drop MSYFitBit.swift in your application. Dard and drop OAuthSwift files in your project. In AppDelegate

func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
if (url.host == "fivedotsFitbit") {
OAuthSwift.handleOpenURL(url)
}
return true
}

In Your ViewController

MSYFitBit.shareFitBit.fetchDataFromFitbit { (result, success) -> Void in

}

Advertisements