android / fit-samples

Multiple samples showing the best practices using the Fit APIs on Android.
Apache License 2.0
153 stars 113 forks source link

Scope for HealthDataTypes of Google Fit #6

Open codingjeremy opened 5 years ago

codingjeremy commented 5 years ago

Issue by ViTVetal Tuesday Jun 13, 2017 at 15:33 GMT Originally opened as https://github.com/googlesamples/android-fit/issues/22


I want read HealthDataTypes (temperature, blood pressure and glucose). Which Scope I must set when create GoogleApiClient?

.addScope(new Scope(????))

codingjeremy commented 5 years ago

Comment by mcpotter Tuesday Aug 08, 2017 at 02:10 GMT


I'm curious too. Can anyone shed some light on this? I'm unable to read the data (it just gives me a result along the lines of "Application needs OAuth consent from the user" because we don't have the required Scope specified, if such a Scope exists).

codingjeremy commented 5 years ago

Comment by mohananr-tpvision Monday Sep 11, 2017 at 04:47 GMT


addScope(new Scope("https://www.googleapis.com/auth/fitness.blood_pressure.read")) works. This atleast helps you resolve the "Application needs OAuth consent from the user". I really dont have an app or a device that would sync HealthData (BP or glucose) into google fit. So, im not able to test anything. Do you know if there is a device or app in the market that would write healthdata into google fit ?

codingjeremy commented 5 years ago

Comment by mohananr-tpvision Monday Sep 11, 2017 at 04:47 GMT


You can also refer to my stackoverfloww link on the same topic. https://stackoverflow.com/questions/46110711/google-fit-rest-api-support-for-new-healthdatatypes?noredirect=1#comment79232750_46110711

codingjeremy commented 5 years ago

Comment by FalmaJeus Monday Aug 20, 2018 at 10:31 GMT


Hello, Have you found any apps that write blood pressure data. https://play.google.com/store/apps/details?id=com.getqardio.android&hl=en Please try this qardio app. They say that this app syncs data with Google fit and it has option to input blood pressure manually. I am not sure that it actually writes data or not. I had made manual blood pressure data and tried to read /datasources with google fit rest api, but it returns empty array. Of course, the request is authorized. Please help me if you can. Thanks.

codingjeremy commented 5 years ago

Comment by ViTVetal Monday Aug 20, 2018 at 10:53 GMT


@FalmaJeus Hello! Unfortunately, I didn't find the solution. You may write do developers of this app on play store