Showing posts with label Fitbit. Show all posts
Showing posts with label Fitbit. Show all posts

Saturday, September 3, 2016

Unity Fitbit Class finally online!

T.StartPost();

Hey everyone. So I've done 2 posts on Unity and Fitbit and how to get it up and running before.
Lots of people have been asking about the UnityFitbit class that I either mentioned I would get online (and have just been busy/not wanting to refactor so you guys can actually use it :P )

Well today I finally sat down and refactored it out so it "should be" ready to be used by other people

Find it on Github and feel free to submit fixes/updates etc. to it as well.

https://github.com/TravisEvashkevich/UnityFitbit

By all means there is some crap in there that I should clean up (the Json convert to XML for starters)
But this is just what I've been using because it's what "I" need personally for my project.

If you think you can help out by making it work better and just in the JSON by all means please make a branch and submit some pull requests :D

T.Out();

PS: Make sure to check out http://technicalartistry.blogspot.ca/2016/01/fitbit-unity-oauth-2-and-native.html  if you need to figure out how to get it all working natively (as per Fitbit's ToS)

Tuesday, January 12, 2016

Fitbit, Unity, OAuth 2 and NATIVE browser...and about a week of cursing.

T.StartPost();

SO! I found out not too long after my last post that I (and everyone else using Fitbit data) would not longer be allowed to use Webview based solutions for gaining access to Fitbit data via OAuth 2.

This creates quite the predicament as when you're using Unity there's no Unity specific way of getting the OAuth return code from the browser (such as Chrome, Safari etc.)

This meant that I had to spend about the last week cursing while trawling the internet for solutions. Unfortunately there is a bunch but some of them do not seem to work. THANKFULLY, how ever, there is one that I found that DID work and I have to definitely give credit where credit is due and say that without Ofer Reichman's blog post I probably would not have gotten this to work.

You can pretty much follow his verbatim to get it working but I will also transcribe some small differences in things that work for Fitbit .  Also I'm working on refactoring my FitbitAPI class for Unity. I'm likely to just release it on Github for the betterment of the community and so others can help to make it better and learn from it as well.)

So without Further-Ado:

How to Do OAuth 2 authentication in Unity FOR Fitbit..With a Native Browser (Known to work with Android)


**If you want more in depth reading you can read Ofer's post but I'm just going to cover the nitty gritty of getting it to work with Fitbit**

Assumptions by me:
-You already have an app registered with Fitbit
-You already have Android SDK's installed
-You already have decent knowledge of Unity

I'm using :
Windows 10
Eclipse Juno (but shouldn't make a difference if you're using a higher version)
Unity 5




Hope this helps :) Feel free to comment and hopefully I can help (no promises though)

T.Out();