10-16-2014 14:55
10-16-2014 14:55
I'm trying to build an iOS app that integrates with Fitbit. I've got to the point where the user is presented with a webview so that they can login, but after login it always takes them to the PIN page. I changed my app from "Desktop" to "Browser", like many stack overflow posts suggested, but still no luck. Any thoughts?
10-16-2014 15:31
10-16-2014 15:31
Please check that you provide a valid callback url.
You can do it viaoauth_callback request parameter(see https://wiki.fitbit.com/display/API/OAuth+Authentication+in+the+Fitbit+API) or at dev.fitbit.com.
10-16-2014 15:35
10-16-2014 15:35
Thanks for the suggestion!
An answer on the Google forums suggested that the callback URL register with the application didn't matter, and you could simply pass the URL as a parameter. It appears that the URL passed and the URL registered have to match exactly, otherwise you get redirected to the PIN page.
For anyone else that comes accross this, this post got me 90% of the way. Making the URL's match got the other 10%
http://omarmetwally.quora.com/Integrating-the-Fitbit-API-in-iOS-apps
10-16-2014 22:46 - edited 10-16-2014 22:48
10-16-2014 22:46 - edited 10-16-2014 22:48
Url that is registered and url that you send as parameter may not match.
If you have both registered callback url and sending it as parameter then the one that sent as parameter will be used.
In other words you can register callback one url and still have an option to override it in oauth_callback parameter when you need it.
Say if you register in app http://a.com and then sending in oauth_callback http://b.com, then once authenticated, user will be redirected to http://b.com.