0
因此,我得到的錯誤是:HTTP狀態401:未經授權,響應:{「errors」:[{「errorType」:「invalid_request」,「message」:「需要授權標頭需要授權標題Fitbit Swift oauth
我有授權fitbit的代碼是:
func authorizeFitbit(completion: (result: Bool) -> Void){
oauthswift.accessTokenBasicAuthentification = true
let state: String = generateStateWithLength(20) as String
oauthswift.authorizeWithCallbackURL(NSURL(string: "xxxxxxxxx")!, scope: "xxxxxxxxxxxxx", state: state, success: {
credential, response, parameters in
self.getUserProfile(){
(result: Bool) in
completion(result: result)
}
}, failure: { error in
print(error.localizedDescription)
completion(result: false)
})
}
我能搶的個人資料,但是當我試圖通過點擊IBAction爲按鈕,抓住從fitbit更多的信息,我需要使用此再次授權功能以獲取步數