我们正在尝试实时检索用户的步数。如果用户当前正在运行,则我们尝试获取已执行步骤的最新值。虽然我们可以在今天的前一天检索步骤的值,但在当前日期仍无法检索。
API URL:https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate
请求Json:
{"aggregateBy":[
{"dataTypeName":"com.google.step_count.delta",
"dataSourceId":"derived:com.google.step_count.delta:com.google.android.gms:estimated_steps"}],
"bucketByTime":{"durationMillis":86400000},
"startTimeMillis":1557685800000,
"endTimeMillis":1557772199999
}
已收到回复:
{"bucket":[
{"startTimeMillis":"1557685800000",
"endTimeMillis":"1557772199999",
"dataset":[
{"dataSourceId":"derived:com.google.step_count.delta:com.google.android.gms:aggregated",
"point":[]}
]}
]}