1

我正在开发一个网络应用程序,它需要定期从 Google Fit 获取用户的步数。我浏览了 API 文档并找到了 REST End Point:https ://www.googleapis.com/fitness/v1/users/me/dataset:aggregate ,它给出了步数。我以以下格式将数据传递到此 POST 端点。

{
    "aggregateBy": [
        {
            "dataTypeName": "com.google.step_count.delta",
            "dataSourceId": "derived:com.google.step_count.delta:com.google.android.gms:estimated_steps"
        }
    ],
    "bucketByTime": {
        "durationMillis": 86400000
    },
    "startTimeMillis": 1630568107871,
    "endTimeMillis": 1630571402415
} 

从上述请求返回的步数与我的 Google Fit 应用中显示的步数不同。我试着搜索了几天,但没有找到任何东西。如何从该 API 获取正确的步骤,如 Google Fit 应用程序所示

4

0 回答 0