HKQueryAnchor Becomes Invalid After App Reinstallation

31 views Asked by At

I'm developing an iOS application that uses HealthKit and leverages HKQueryAnchor for fetching incremental updates to avoid pulling the entire dataset each time. This method works well until the app is deleted and subsequently reinstalled.

Post-reinstallation, when I restore a previously saved HKQueryAnchor and use it in an anchored query, it behaves as though no anchor was passed, returning the entire dataset instead of incremental updates. This issue seems to arise solely after an app has been deleted and reinstalled; HKQueryAnchor functions as expected if the app is not removed.

I anticipated that restoring and utilizing the HKQueryAnchor, even after deleting and reinstalling the app, would allow the application to continue from where it left off before deletion, fetching only new HealthKit data entries.

Is this assumption wrong? or am i missing something?

0

There are 0 answers