2

When using Googlefit REST Aggregate API, we need to send startTimeMillis and endTimeMillis to get user's step data, for example.

{
  "aggregateBy": [
    {
      "dataTypeName": "com.google.step_count.delta",
      "dataSourceId": "derived:com.google.step_count.delta:com.google.android.gms:estimated_steps"
    }
  ],
  "startTimeMillis": 1568044800000,
  "endTimeMillis": 1569004617000,
  "bucketByTime": {
  "period": {
    "timeZoneId": "Europe/Madrid",
    "type": "week",
    "value": 1
  }
}

The startTimeMillis and endTimeMillis params need to be sent according to the users' timezone, in our use case.

Does Googlefit REST API have an API to get the timezone of the device that sent that information? (I couldn't find it).

if not, what other strategies could we use to get the user's timezone. Does it exist this information in any other Google services API?

In the worst case scenario, we could send the users' location or timezone whenever they open our app, but I would like to avoid that, if possible.

Thanks.

Jordi
  • 160
  • 1
  • 9

0 Answers0