https://developer.apple.com/documentation/clockkit/creating_and_updating_a_complication_s_timeline
I just run sample app to check background delivery on health kit.
I added caffein on my health app on phone. but it dosen't triggered on obeserver processUpdate function.
func processUpdate(query: HKObserverQuery,
completionHandler: @escaping () -> Void,
error: Error?) {
print("processUpdate come!!!!")
logger.debug("Received an update from the background observer query.")
// Check for any errors that occur while setting up the observer query.
guard error == nil else {
logger.error("Unable to set up a background observer query: \(error!.localizedDescription)")
fatalError()
}
logger.debug("Responding to a background query.")
Task {
// Load the updated data from the HealthKit Store.
let success = await loadNewDataFromHealthKit()
// Check for any errors.
guard success == true else {
logger.error("Unable to query for new or deleted caffeine samples.")
fatalError()
}
// Call the completion handler when done.
completionHandler()
}
}