Write data to Firebase in the background after retrieving steps with HealthKit's background delivery
I have an HKObserverQuery setup to fetch steps in the background ( enableBackgroundDelivery method is called in application:didFinishLaunchingWithOptions: ). The steps are retrieved in the background, but I would also like to store the retrieved steps in a Firebase database. This part is failing though, nothing is stored in Firebase. The method to store the steps does work correctly when the app is in the foreground. Any ideas on how to successfully write data in Firebase while in the background would be appreciated. class HealthKitManager { static let shared = HealthKitManager() private let