Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iOS OAuth Callback

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?

Best Answer
0 Votes
3 REPLIES 3

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.

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes

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

Best Answer
0 Votes

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.

 

Ivan Bahdanau
Senior Software Developer at Fitbit
Best Answer
0 Votes