I am trying to use FitBit api in iOS application. I have a fitbit device and I am trying to create an iOS app that connects with the FitBit api and gets my data back. I am trying to implement OAuth2.0. I already have the client ID but I have been stuck. I am not sure how to proceed with this. I have read the documentation on how OAuth works and how fibit works with OAuth2.0 . My problem is I don't know how to open the fibit api authenication by the user, and how to get the access token. How do I proceed after getting the access token.
I am a noob to this, so I would appreciate if somebody can guide me how to go with that. If someone can guide me to similar projects it will be awesome.
Thanks
Implementing OAuth isn't a simple task. I started with Christian Hansen's OAuth Example and modified it to work for my project (his is for Google, but it can be changed to work with FitBit or anything else).
You can also check out one of the many OAuth Client wrappers on GitHub. Those two should get you close enough that you can start asking more specific questions.
Related
I'm using thephpleague oauth client library and everything works fine except for Google authentication. It seems I have to enable my domain somewhere to be able to use Google apps.
https://support.google.com/a/answer/33419?hl=en
This was not helpful indeed as I don't understand what I have to do. Am I obligated to pay for having a working OAuth connection with Google? I don't have a company, I don't need the apps, cloud or any other thing then a working API.
EDIT: to be clear I already wrote my libraries for OAuth and it's all working, it's Google that needs me to do something on domain level.
You don't have to pay. First of all you need to create a project in the Google Developers Console. Then get your credentials. I don't know which API you are going to access. Have a look at this.
https://developers.google.com/identity/protocols/OAuth2?csw=1
Additional - This site was very helpful for using the Google Calendar API
http://www.daimto.com/accessing-google-calendar-with-php-oauth2/#Conclusion
Hope you find what you are looking for.
So I'm trying to build an iOS app (Swift 2) which integrates FitBit.
Once the user open the 'Walks' page, the user should be able to see his daily number of steps.
Ideally, we do not want every user to register to FitBit.
So I'm trying to figure out if there is a way to fetch the data from your Fitbit directly, rather than calling the Fitbit API every time. I only require the number of steps walked daily.
TIA!
Currently there is only one way to fetch data from FitBit, Oauth 2.0
API. There is no other way. So it is not possible to fetch FitBit data
without SignIn.
If you want to integrate FITBIT OAUTH 2.0 API, Follow step by step FITBIT tutorial
https://appengineer.in/2016/04/30/fitbit-aouth-in-ios-app/
The short answer seems to be: No.
"The Fitbit API" is an HTTP OAuth rest api, which allows your server (or http-client) to exchange data with the Fitbit servers.
To the best of my knowledge there is no other API or official way to get to this data. Also fitbit does not currently write to the HealthKit Api, so it is not possible to get step data that way. According to this article:
https://gigaom.com/2014/12/24/how-to-use-a-fitbit-with-apple-health/
there should be some workaround, but I have not tried this trick, and it might have other disadvantages and require your users to install other apps on their phones. I imagine that the dataexchange between the fitbit and the phone through bluetooth would be encrypted but that is purely speculation on my side :-)
We have chosen to use the official fitbit Api which has excellent documentation and is rock-solid. Good luck in your endeavors!
I need to add to my iPhone app a log-in btn through Tripit.
I understand that I need to connect through OAuth and then integrate Tripit API.
But I don't understand what is going on, which part of the code (of both OAuth and Trippit) should I implement? and where (is the whole OAuth code with the log-in supposed to be called when pressing the log-in btn?).
Does anyone have maybe an example? Or a lighter explanation for the API for ios?
OAuth is used to connect your app to the user's Tripit account. After connecting, you will have OAuth tokens to store and use when making the API requests. Here is some information from a Tripit person on suggestions for OAuth and JSON libraries to use on iOS.
I have a j2me project on blackberry that needs to connect to twitter. I did most of the hard stuff already, I've got an api that guided me through to the access token pretty easily. Now I can't seem to get the authentication to work with a status update in REST.
I know my tokens are valid because if I run a GET method like verify credentials, it's fine, everything is valid. But POST messages are just confusing me. Am I supposed to pass in a whole consumer key, signature, oauth version, etc every time I update a status? Or do I just pass the access token? Are they all supposed to be POST variables or just the ones specified in the twitter api as parameters. The twitter api documentation has left me completely lost.
If someone had a link to a site that had examples of all of these messages put into plain text NOT in an library as 99% of tutorials for this situation are, it would be really helpful.
I've tried a couple of ways (http://emmense.com/php-twitter/ and http://www.webmaster-source.com/2009/04/05/post-to-twitter-from-a-php-script/) to post updates to my twitter account but I am getting the response:
Basic authentication is not supported
I had a look at the twitter website and they said something about the new OAuth for authentication. Is this why my code isn't working?
Does anyone know of some PHP code that works?
This is correct. They recently adopted OAuth as their sole login platform for 3rd party apps as a security precaution.
Check out their developer area for examples:
http://apiwiki.twitter.com/w/page/22554657/OAuth-Examples
Basic auth is deprecated now. Check out this library https://github.com/abraham/twitteroauth for using OAuth in your application
It took me several hours to create this PHP script but it is working. Just make sure that your hosting company supports cURL. If you don't need the geo features you can cut them out.