12-11-2015 10:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-11-2015 10:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
We have a problem connecting FitBit to Unity through the game.
The issue is this, https://dev.fitbit.com/docs/oauth2/. Specifically, "Android applications may use Chrome Custom Tabs instead of app switching to the default browser. Use of WebView is prohibited."
The problem is that there is only one useful plugin to allow webviewing ingame, which using webview.
We currently have Apple's Health Aoo connected to the game and not being able to connect the game using currently available plug ind for unity prevents us and other developers from launching on Android based devices, which is a much bigger market.
Has anyone created a plug in that allows for use of Chrom Custom Tabs in Unity? Or what is a way to solve this issue?
12-12-2015 14:00 - edited 12-12-2015 14:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-12-2015 14:00 - edited 12-12-2015 14:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
My team and I have been reading up on solutions to this issue. It seems like every developer uses WebView, even though the documentation says it is prohibited.
Is it prohibited or is WebView allowable? Why is it prohibitied and what does that even mean?

01-02-2016 14:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-02-2016 14:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
In the same boat.
Would love to know what us Unity devs are supposed to do.

01-04-2016 17:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-04-2016 17:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm not familiar with Unity development, but I think you need to call Application.OpenURL.
timlcooley wrote:
Is it prohibited or is WebView allowable? Why is it prohibitied and what does that even mean?
WebViews are not permitted. Applications should foreground the native browser to display the Fitbit OAuth 2 authorization page. Then, applications should use custom URL handlers as callback URLs so the user is returned to the app after authorizing.
WebViews can be used an attack vector. Apps could intercept people's Fitbit password and modify the authorization page's contents. We permit SFSafariViewController and Chrome Custome Tabs, as they provide the necessary security constraints to prevent the type of attacks described earlier.

01-05-2016 12:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-05-2016 12:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
The problem with that is using Application.OpenURL doesn't allow us to get a callback from it (at least not that I or anyone else I've found has been able to do such.) as that just opens the native browser.
I'd be willing to use the natvie or the SFSafariViewController/Chrome Tabs if I could actually put it in my app without having to go and likely, wrap everything manually just to be able to use it...

01-05-2016 12:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-05-2016 12:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@TEvashkevich wrote:
The problem with that is using Application.OpenURL doesn't allow us to get a callback from it (at least not that I or anyone else I've found has been able to do such.) as that just opens the native browser.
This is what custom URL schemes allow you to do. You need to register your scheme (e.g. myapp://) and decide on a callback path (e.g. myapp://auth/fitbit/callback). Then, Fitbit will redirect the user to your app from the device's browser.

01-07-2016 22:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-07-2016 22:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Yes I'm aware that they do that, the problem is that it's a very very big pain to capture the access token when using Unity as you don't have as easy as Native apps (meaning I can't just grab it from Intents etc).
I've been trying to get it to work with android plugins and such but it's really not working...gonna have to keep smashing my head against this wall instead of doing meaningful development till it's fixed it seems.

