首先我创建了一个帐户https://www.fitbit.com然后我关注了一个应用程序https://dev.fitbit.com然后安装OAuthSwift使用可可豆荚并在我的 AppDelegate 中实现了此方法
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
if (url.host == "oauth-callback") {
OAuthSwift.handleOpenURL(url)
}
return true
}
now i want to get the data (Name, Steps taken etc) of user account I created at https://www.fitbit.com
how can I do that ? I searched but was not able to find any tutorial on fitbit integration. And where to use this information in my code?
So please guide me about next step what should I do to get the data.
FitBit 使用 OAuth 2.0 API,需要客户端 ID 和密钥。您需要这些客户端 ID 和密钥才能使用 OAuth 2.0 API 进行身份验证。
有一篇博客文章涉及 iOS 中 FitBit 与 Swift 的集成。
让我们查看并学习“如何在 iOS 中实现 fitbit”https://appengineer.in/2016/04/30/fitbit-auth-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"
)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)