【发布时间】:2021-09-15 13:18:16
【问题描述】:
问题
当我致电 GoogleFit.getDailyStepCountSamples() 检索步数时,我收到的步数远低于 Google Fit 应用中显示的步数。
开发环境
MacOS 大苏尔 反应原生 0.63.3 Android 模拟器 - Nexus 5 API 19
复制步骤
设置您的步骤选项并调用该函数。代码如下所示
const stepsOpt = {
startDate: '2021-09-15T00:00:00.000Z', // the start of the day in question
endDate: new Date().toISOString(), // you could also set this to the end of the day
bucketUnit: 'MINUTE',
bucketInterval: 1
}
const res = await GoogleFit.getDailyStepCountSamples(stepsOpt)
console.log(`\n\nMy step data is\n${JSON.stringify(res, null, 2)}\n\n`)
在生成的日志中,观察来自任何com.google.android.gms 源的数据。查看总步数和 rawSteps。
将此与 Google Fit 应用程序中显示的当天总步数进行比较(可以通过打开 Google Fit 应用程序 -> 首页 -> 找到趋势/步骤 -> 日 -> 查看源数据)
我观察到的
总步数和 rawSteps 不匹配
我的预期
- 查看总步数之间的匹配项
- 查看 rawStep 数据中的一些匹配项
截图
左边是运行我的代码后的日志截图。右图是根据 Google Fit 应用的原始数据截图。
【问题讨论】:
标签: android react-native google-fit