我使用以下PHP命令从Google Fit检索步骤:
$dataset->get('me','derived:com.google.step_count.delta:com.google.android.gms:derive_step_deltas<-derived:com.google.step_count.cumulative:com.google.android.gms:HTC:HTC One:3863da10:soft_step_counter','1397515179728708316-1423267952728708316');
这会收到Google_Service_Fitness_Dataset,但不包含任何积分:
{
"minStartTimeNs": "1397515179728708316",
"maxEndTimeNs": "1423267952728708316",
"dataSourceId": "derived:com.google.step_count.delta:com.google.android.gms:derive_step_deltas\u003c-derived:com.google.step_count.cumulative:com.google.android.gms:HTC:HTC One:3863da10:soft_step_counter"
}
当我使用API Explorer时,除了结果中的几百个点外,它还会显示上面的数据集。例如:
"point": [
{
"startTimeNanos": "1416618389952000000",
"endTimeNanos": "1416618449952000000",
"dataTypeName": "com.google.step_count.delta",
"originDataSourceId": "derived:com.google.step_count.cumulative:com.google.android.gms:HTC:HTC One:3863da10:soft_step_counter",
"value": [
{
"intVal": 1
}
],
"modifiedTimeMillis": "1416620672890"
}
我做错了是什么导致这些点出现在API Explorer中,而不是出现在我的PHP应用程序中?
我也尝试使用OAuth 2.0 Playground,但它也没有显示要点。我目前只在所有实现中使用健身活动读取范围(https://www.googleapis.com/auth/fitness.activity.read)。提前感谢任何见解!