Google Fit Rest Api 步数与 Fit App 不一致且不同
Google Fit Rest Api Step Counts inconsistent and different from Fit App
这似乎是一个很常见的问题,当有人用 google 寻求帮助时有很多条目,但还没有任何帮助。
我发现 REST API 为 estimated_steps 提供的结果与设备应用程序中出现的结果大不相同。
我 运行 通过 PHP/Laravel 应用程序上的 cron 作业为用户执行获取任务。
我正在使用这个 https://developers.google.com/fit/scenarios/read-daily-step-total - estimated_steps 来检索步数。
有些日子数据是正确的。有些日子它完全不同。例如,在某一天,REST API 给出的步数为 5661,而应用程序显示为 11,108。则有六七日流正。
有人遇到过这种行为吗?我测试了时区差异,记录并分析了响应 json 看看我是否犯了一些明显的错误,但没有。
您可以查看此 How do I get the same step count as the Google Fit app? 文档。请注意,即使使用正确的数据源,您的步数仍可能与 Google Fit 应用程序的步数不同。
This could be due to one of the following reasons:
- On Wear, the Fit MicroApp when connected will display step counts queried on the phone and transferred over via the Wearable APIs. Other MicroApps accessing local-only data will only get watch steps. We are working on making this easier for developers.
- Sometimes the step calculation code for the Google Fit app is updated with bug fixes before we are able to release the fixes to developers (which requires a Google Play Services release). We are also working on making it possible for developers to access fixes at the same time.
Fit 应用程序使用特定数据源作为步骤,并在默认合并步骤流的基础上添加了一些功能(可以在文档中看到)。
您可以访问 "estimated" 步骤流,如下所示:
derived:com.google.step_count.delta:com.google.android.gms:estimated_steps
希望对您有所帮助!
这似乎是一个很常见的问题,当有人用 google 寻求帮助时有很多条目,但还没有任何帮助。
我发现 REST API 为 estimated_steps 提供的结果与设备应用程序中出现的结果大不相同。
我 运行 通过 PHP/Laravel 应用程序上的 cron 作业为用户执行获取任务。
我正在使用这个 https://developers.google.com/fit/scenarios/read-daily-step-total - estimated_steps 来检索步数。
有些日子数据是正确的。有些日子它完全不同。例如,在某一天,REST API 给出的步数为 5661,而应用程序显示为 11,108。则有六七日流正。
有人遇到过这种行为吗?我测试了时区差异,记录并分析了响应 json 看看我是否犯了一些明显的错误,但没有。
您可以查看此 How do I get the same step count as the Google Fit app? 文档。请注意,即使使用正确的数据源,您的步数仍可能与 Google Fit 应用程序的步数不同。
This could be due to one of the following reasons:
- On Wear, the Fit MicroApp when connected will display step counts queried on the phone and transferred over via the Wearable APIs. Other MicroApps accessing local-only data will only get watch steps. We are working on making this easier for developers.
- Sometimes the step calculation code for the Google Fit app is updated with bug fixes before we are able to release the fixes to developers (which requires a Google Play Services release). We are also working on making it possible for developers to access fixes at the same time.
Fit 应用程序使用特定数据源作为步骤,并在默认合并步骤流的基础上添加了一些功能(可以在文档中看到)。
您可以访问 "estimated" 步骤流,如下所示:
derived:com.google.step_count.delta:com.google.android.gms:estimated_steps
希望对您有所帮助!