Open mohamadfala opened 6 months ago
You can check the proof of concept of this in this tree:
https://github.com/matinzd/react-native-health-connect/tree/headless_poc
https://developer.android.com/health-and-fitness/guides/health-connect/develop/read-data
This page last updated 2024-09-30 UTC and states: "Health Connect allows apps to read data from the datastore when the app is in the foreground and background"
And it works ! I tested setting up a background-fetch that queries Health Connect for step counts in the background, and also triggering the task in the background using a silent push notification from my backend. Steps are returned as expected.
I would like to implement the ability to receive data from the health connect integration in the background without using background tasks with periodic updates. Is there any way to listen to an even in the background that will fire a synchronization method in my application and send new records to the server?
I was able to accomplish this in React Native Healthkit using NativeEmitter.