0

What is the data source for location in the google fit rest API? I'm not able to find any data sources for location. I want to access the location from the google fit application. Does anybody know how can I access a datasourceID for location?

I used the following get request to find the list of data sources. I'm not able to find any relevant dataSourceID for location. Please suggest what to do

GET https://www.googleapis.com/fitness/v1/users/me/dataSources
  • According to the docs: "Note: This data can only be read by the app that wrote the data. Your app can only read back data it wrote. It cannot read location sample data written by other apps". Source: https://developers.google.com/fit/datatypes/location#location_sample – Keegan Teetaert Feb 22 '21 at 15:51
  • @KeeganTeetaert your comment is correct. You should post that as an answer. – Andy Turner Feb 22 '21 at 16:54
  • So it's not possible to get my Google fit application's location? Can you give an example where we can access data? – Ganesh C K M Feb 22 '21 at 17:30
  • @GaneshCKM If you have an application that records fitness data containing a user's location in the Fitness API, than that same application would be able to read the location. – Keegan Teetaert Feb 22 '21 at 20:50
  • @KeeganTeetaert I tried tracking workouts where it tracks locations of where we walk and run.But it's not displaying that as a location Source – Ganesh C K M Feb 23 '21 at 07:07
  • @GaneshCKM "I tried tracking workouts where it tracks locations of where we walk and run" how did you do this? Was your application writing location data itself? If not, it cannot read location data; if it is, your application can only read the data it wrote. – Andy Turner Feb 23 '21 at 11:51
  • @AndyTurner No, I understood it wrong. What Keegan told was right. Location has a data source if and only if we create and write the location on it. – Ganesh C K M Feb 24 '21 at 03:05

1 Answers1

3

According to the docs:

Note: This data can only be read by the app that wrote the data. Your app can only read back data it wrote. It cannot read location sample data written by other apps

Source: developers.google.com/fit/datatypes/location#location_sample

Andy Turner
  • 137,514
  • 11
  • 162
  • 243
Keegan Teetaert
  • 643
  • 6
  • 22