Post

Replies

Boosts

Views

Activity

Reply to Sleep Analysis inBed sample not recorded on Apple Watch in iOS 18
This is causing a problem for me as well. I was relying on "In Bed" samples to group sleep samples into different sessions; without the "In Bed" samples, there is no easy way to determine when one sleep session ends and another begins. It seems like a conscious decision by Apple but I hope it is a bug, or that they reconsider this change. In the meantime, does anyone have a suggestion of another way to group sleep samples into separate sleep events?
Nov ’24
Reply to Old HealthKit samples from WatchOS getting deleted and recreated years later
@DTS Engineer that is very helpful, thank you so much. There is a walk workout that overlaps with these step samples, so I believe you are correct. I have a related question for you if you don't mind. I am querying HealthKit step data using an HKAnchoredObjectQuery. In the initial query, I pass a predicate to only get step samples that happened in the past couple days. Once I get back a valid anchor, I tear down that initial query and set up a new HKAnchoredObjectQuery with the anchor and no predicate - that way I can receive any new step samples that get created, no matter the start and end dates. For some reason, the anchor I get back in the initial query doesn't contain these "condensed" samples. So when I do the new query using the anchor, the resultsHandler receives these condensed samples, even though they are older than the anchor. I would expect that the condensed samples would be included in the samples the initial anchor covers, so that they wouldn't be returned in a query that uses that initial anchor. Is this a bug, or am I misunderstanding how anchors work?
Sep ’25
Reply to Sleep Analysis inBed sample not recorded on Apple Watch in iOS 18
This is causing a problem for me as well. I was relying on "In Bed" samples to group sleep samples into different sessions; without the "In Bed" samples, there is no easy way to determine when one sleep session ends and another begins. It seems like a conscious decision by Apple but I hope it is a bug, or that they reconsider this change. In the meantime, does anyone have a suggestion of another way to group sleep samples into separate sleep events?
Replies
Boosts
Views
Activity
Nov ’24
Reply to Old HealthKit samples from WatchOS getting deleted and recreated years later
@DTS Engineer that is very helpful, thank you so much. There is a walk workout that overlaps with these step samples, so I believe you are correct. I have a related question for you if you don't mind. I am querying HealthKit step data using an HKAnchoredObjectQuery. In the initial query, I pass a predicate to only get step samples that happened in the past couple days. Once I get back a valid anchor, I tear down that initial query and set up a new HKAnchoredObjectQuery with the anchor and no predicate - that way I can receive any new step samples that get created, no matter the start and end dates. For some reason, the anchor I get back in the initial query doesn't contain these "condensed" samples. So when I do the new query using the anchor, the resultsHandler receives these condensed samples, even though they are older than the anchor. I would expect that the condensed samples would be included in the samples the initial anchor covers, so that they wouldn't be returned in a query that uses that initial anchor. Is this a bug, or am I misunderstanding how anchors work?
Replies
Boosts
Views
Activity
Sep ’25