WatchOS 26.1 - Steps Background delivery not working

I am using this below code since WatchOS 10 to set the user steps observer and get the callback of steps whenever changes.

This is still working perfectly fine till watchOS 11 but when i updated to watchOS 26.1, I am not getting the callback of steps, like the observer is not working at all. I should get a callback inside query block whenever user take steps, but it is not working in watchOS 26.1.

func setupStepCountObserver(completion: @escaping (Double, Double) -> Void) { let stepCountType = HKObjectType.quantityType(forIdentifier: .stepCount)!

let query = HKObserverQuery(sampleType: stepCountType, predicate: nil) { [weak self] _, completionHandler, error in
  if let error = error {
    print("Error setting up observer query: \(error.localizedDescription)")
    return
  }
  
  // Fetch the latest step count data
  self?.getLast20SecTodaysSteps(completion: completion)
  
  // Call the completion handler to let HealthKit know you have processed the update
  completionHandler()
}

// Execute the query
healthStore.execute(query)

// Enable background delivery of updates
healthStore.enableBackgroundDelivery(for: stepCountType, frequency: .immediate) { success, error in
  if let error = error {
    print("Error enabling background delivery steps: \(error.localizedDescription)")
  } else if success {
    print("Background delivery enabled for steps.")
  }
}

}

One typical reason is that the completionHandler of HKObserverQuery is not called in time – When that happens, the system may refuse to call the callback again. Yoru code doesn't show the complete implementation of the callback, and so it's unclear if that can happen or not.

Given that the same code works watchOS 11 but not on watchOS 26, however, I'd suggest that you start with filing a feedback report – If you do so, please share your report ID here for folks to track.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Feedback Id - FB21060427

@DTS Engineer  This is how i am fetching the steps and calling completion, but I am not even getting callback in HKObserverQuery in watch OS 26.1, after the callback only getsteps function will run

func getTodaysSteps(completion: @escaping (Double) -> Void) {

let stepsQuantityType = HKQuantityType.quantityType(forIdentifier: .stepCount)!

let now = Date()

let startOfDay = Calendar.current.startOfDay(for: now)

let predicate = HKQuery.predicateForSamples(

  withStart: startOfDay,

  end: now,

  options: .strictStartDate

)



let query = HKStatisticsQuery(

  quantityType: stepsQuantityType,

  quantitySamplePredicate: predicate,

  options: .cumulativeSum

) { _, result, _ in

  guard let result = result, let sum = result.sumQuantity() else {

    completion(0.0)

    return

  }

  completion(sum.doubleValue(for: HKUnit.count()))

}



healthStore.execute(query)

}

WatchOS 26.1 - Steps Background delivery not working
 
 
Q