I'm trying to query, with the Fit rest API, segmented data from an iphone that have installed GoogleFit and configured the sync between apple health and googelfit.
To my android phone, I get the data as expected with this POST:
(*)
"aggregateBy": [
{
"dataSourceId": "derived:com.google.step_count.delta:com.google.android.gms:estimated_steps",
"dataTypeName": "com.google.step_count.delta"
},
{
"dataSourceId": "derived:com.google.distance.delta:com.google.android.gms:merge_distance_delta",
"dataTypeName": "com.google.distance.delta"
}
{
"dataSourceId": "derived:com.google.active_minutes:com.google.android.gms:merge_active_minutes",
"dataTypeName": "com.google.active_minutes"
}
],
"endTimeMillis": 1643325227000,
"startTimeMillis": 1640991600000,
"bucketByActivitySegment": {
"minDurationMillis": 600000
}
}
But from the iphone user, this returns an empty bucket.
I checked the available data dataSources for the apple user. I did some "trial and error" on the dataSourceIds connected to "active_minutes". In particular
- derived:com.google.active_minutes:com.google.ios.fit:appleinc.:iphone:1148c16f:top_level
- derived:com.google.active_minutes:com.google.ios.fit:appleinc.:watch:f40f5c4a:top_level
The trial and error werer conducted with aggregateBy post with one of the above sources, so no distance and step_count involved. The two above dataSourceIds were obtained from a "list post query" for available dataSources, done by the iphone user, with the following scopes:
fitness.activity.read
fitness.location.read
No segmented data is returned from either dataSourceIds (an empty bucket as well). Contents within the apple user's app indicates that there should be segmented data somewhere, see screenshot link.
(Edit: also tried setting "minDurationMillis: 0")
Meanwhile, queries such as:
(**)
{
"aggregateBy": [
{
"dataSourceId": "derived:com.google.distance.delta:com.google.android.gms:merge_distance_delta",
"dataTypeName": "com.google.distance.delta"
}
],
"endTimeMillis": 1643325227000,
"startTimeMillis": 1640991600000,
"bucketByTime": {
"durationMillis": 2333627000
}
}
does return data from the apple user. But I'm really interested in segments (minimum 10 minutes long)
So, question: Anyone with experience getting segmented data from apple-googlefit users?
Figure: iphone screenshot