Well I tried both styles. The initial code was the swiftui .backgroundTask modifier which worked in iOS 18.
I created a core data based logger to see where the hiccup was. I noticed data was indeed being read by the anchored queries from HealthKit. That data was then sent to a couple of published properties in observable objects which served as the start of the combine pipelines.
In ios18 that led to updates that were critical for updating widgets. In iOS 26, the combine pipelines were not activated.
So I switched back to the previous method of background tasks, ie wkapplication.scheduleBackgroundRefresh(...)
That also did not allow any combine pipelines to happen.
In the end, I had to rip out combine from the watch and use didSet and custom handler blocks. While that did work, obviously it's not as full featured (ie, you can't debounce). After using blocks, things went back to functioning properly.
Thoughts?
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags: