Comments (3)
AppleHealthKit.setObserver - this is mostly for background and we can't control when healthKit would fire this event.
It might happens in 5 mins or 20
from rn-apple-healthkit.
So initStepCountObserver() use to detect value change when application in foreground
and setObserver use to detect value change when application in background ?
if i understand it correctly. Is this code below use setObserver with react-native-background-timer in a right way or not ?
BackgroundTimer.runBackgroundTimer(() => {
//code that will be called every 3 seconds
AppleHealthKit.setObserver({ type: 'Walking' });
NativeAppEventEmitter.addListener('observer', () => console.log('fetch new data'));
}, 3000);
from rn-apple-healthkit.
initStepCountObserver
I've checked that, no - it also use background way.
Under both this calls https://developer.apple.com/documentation/healthkit/hkobserverquery is used.
So, if you need to do it in foreground, I can suggest you only to check every second(or so) for new data available or not.
But normally, from my experience, HealthKit publish information with some delay (even in native Health app you can't see step changes with each your step during walking)
from rn-apple-healthkit.
Related Issues (20)
- Is it possible to use this package without setting NSHealthShareUsageDescription?
- Manual Steps in getDailyStepCountSamples vs getStepCount HOT 2
- getDailyStepCountSamples is not getting the total. steps per day !! HOT 2
- check granted 'read' permissions HOT 2
- Question: Is there a way to get samples only from the source that the user has set as a priority?
- Strange issues with iPhones and Apple Watch
- AppleHealthKit.setObserver listener only fires when app is in foreground? HOT 5
- Gathering symptoms from HealthKit HOT 3
- Version 0.8.0 not resolved into tag 0.8v
- getting error on getStepCount() HOT 6
- Myproj/node_modules/rn-apple-healthkit/Pods/Target Support Files/Pods-RCTAppleHealthKit/Pods-RCTAppleHealthKit.debug.xcconfig: unable to open file (in target "RCTAppleHealthKit" in project "RCTAppleHealthKit") (in target 'RCTAppleHealthKit') HOT 1
- Is this project abandonned? HOT 25
- getDistanceSwimming and getSwimmingStrokeCount not working in this library ? Are these removed or what?
- getAuthorizationStatusString function always returns HKAuthorizationStatusSharingDenied
- Read water sample(s) for specific date HOT 1
- README confuses height with age
- Can't get Demo working
- _rnAppleHealthKit.default.initHealthKit is not a function
- getSample() crashing reading Apple iWatch apple health workout entries HOT 2
- App Store Distribution fails on valid com.apple.developer.healthkit.access value HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rn-apple-healthkit.