Background HealthKit observer queries between app launches

Today I needed to debug some code that is using HealthKit, running observer queries in the background, also when the app is not running.

The app could create multiple observer queries on the same sample types, but only the one created last should be considered the correct one.

There is no much information in the documentation. For instance:

After some empirical tests, these are my conclusions:

I still need to test what happens when your users update the app. Is the query stopped? Does the user need to open the app after update to get a new query to be executed?


Please let me know if you have evidence that disproves my theory above. I would be happy to be enlightened on this subject.


Get a weekly email about Flutter

Subscribe to get a weekly curated list of articles and videos about Flutter and Dart.

    We respect your privacy. Unsubscribe at any time.

    Leave a comment