Users of this app can choose whether they would like to use Healthkit features (they are not necessary for the app to work). I would like to set up an observer query to send data to the server in the background.
According to Apple's documentation at this link: https://developer.apple.com/documentation/healthkit/hkobserverquery/executing_observer_queries
If you plan on supporting background delivery, set up all your observer queries in your app delegate’s application:didFinishLaunchingWithOptions: method. By setting up the queries in application:didFinishLaunchingWithOptions:, you ensure that the queries are instantiated and ready to use before HealthKit delivers the updates.
From my understanding, setting up your observer queries in the application:didFinishLaunchingWithOptions: method means that I would have to prompt users for permissions at the first launch. Is it possible to set up background delivery from another place? For example, could I do so at the same time as I already prompt users for permissions?
Thanks!