Can I use an HKQueryAnchor across multiple devices?

Hello, I am currently working on an app that uses HealthKit to sync health data to a backend server that performs analysis on this data. I am keeping track of the synced data with the HKQueryAnchor I receive for each query I make. I want to address an edge case: if a user has multiple devices running the app, would it make sense to store the anchor on my backend? This would ensure that other instances of the app do not sync data that has already been synced from another device. Thank you for your help!

Answered by DTS Engineer in 822056022

HKQueryAnchor is per-device, and hence is not supposed to be used across devices.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

HKQueryAnchor is per-device, and hence is not supposed to be used across devices.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Can I use an HKQueryAnchor across multiple devices?
 
 
Q