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

Fitbit Authentication using UIWebview iOS

I'm trying to connect to Fitbit  on my iOS native app. I'm using a uiwebview to display to loing and authorization screen. If the user login using their Fitbit credentials it works fine, but if they try to login using Google or Facebook i'm having trouble. When using Google, there is a popup to login and once the user is authenticate it, it tries to do a callback to the parent window but since I'm using a uiwebview it just shows a blank page. Same with Facebook. Anyone have deal with this before? It works on Safari but i need to do it in app to get the access code and all the date to connect and send to the server. Any help?

Best Answer
0 Votes
3 REPLIES 3

Do NOT use a UIWebView. Open the OAuth 2.0 authorization page in Safari. Use an app-protocol:// callback/redirect URI if you are not using a web server.

 

There is no way for people to know that they are entering their Fitbit credentials on an authentic site if they cannot see the URL bar.

Best Answer
0 Votes

This might be a bit of a necro post but:

 

What about those of us that are not developing specific native apps? For example, I've had lots of people comment on a blogpost I made about getting OAuth 2/Fitbit and Unity to work but now I'll have to pester the devs of the Webview I use to do the URL showing etc because I can't exactly just plop native safari/chrome/explorer into my app for this...I would love to just use the native versions but I honestly have no idea how to get that into Unity...

Best Answer
0 Votes

@TEvashkevich: I'm not familiar with Unity development, but I think you'd call Application.OpenURL.

Best Answer
0 Votes