Open JulianKingman opened 5 years ago
I don't have time to find related page in healthKit docs, but I remember that it isn't possible to use react-native-background-fetch to get healthKit data while app in Background. We have to use a built-in HK mechanism for it.
Yes, that’s true of getting the data. That’s why in step 2 it retrieves the data in the background (using healthkit’s HKOvserverQuery, the built-in mechanism) and stores it to AsyncStorage, because (I’m pretty sure) AsyncStorage is available with background fetch.
AFAIK background fetch doesn't run if the device is locked.
This feature will add background observers for an arbitrary number of types of data. Below are my notes and ideas for how to implement this. Your comments and ideas are welcome.
I propose the following:
observe
E.g:To make use of this most effectively, use
react-native-background-fetch
}, (error) => { console.log("[js] RNBackgroundFetch failed to start"); });