Open 256hz opened 1 year ago
I am not sure how obeserveSteps
can cooperate with headless Js if you want it to run in the background.
Since google keeps changing the scope permission back and forth, and deprecate features, Most likely that's why it crashes.
But I'm currently too busy to handle more things.
Thanks for your reply. I think it crashes because it's not set up to receive a callback. Have you been able to use observeSteps
successfully?
@256hz yes for 2 years ago, because the permission request from javascript side was written by me at that moment. As far as I could remember, that function was broken at that moment due to the permission issue, I at least fixed that part of problems, and used it successfully. There are a lot of constraints from React Native & Google Fit regarding the live tracking. But a lot of codes might be obsolete and require full rewrite after Google made ton of changes since android 10
by the way, my fix was pretty immature at that time.
copy that. Feel free to close as won't fix or leave up if you want to address later!
@256hz it's fine, I would leave it open in case ppl encounter the similar issues. The problem is not solved yet regardless.
Hi there,
I would like to periodically (every ~15 min) get step count while the app is backgrounded. Is that possible with
observeSteps
?I was hoping to test this, but the following line causes the app to crash:
GoogleFit.observeSteps((isError, result) => console.log({ isError, result });
When I look at the code for
observeSteps
, it looks like there are no arguments in the method signature:Is this feature intended for use in the way I'm hoping?
RN: 69.1 react-native-google-fit: 0.18.3 (but latest version has the same code)