react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

QUESTION: Is it possible to send the accelerometer information?

Open tofoli opened this issue 8 years ago • 5 comments

Is it possible to create a new action to send the information collected with the accelerometer sensor?

tofoli avatar Nov 14 '18 19:11 tofoli

Not currently.

Why not use an existing 3rd party lib accelerometer lib?

christocracy avatar Nov 14 '18 19:11 christocracy

@christocracy do you know anyone who works in the background?

tofoli avatar Nov 16 '18 09:11 tofoli

If background-geolocation is running in background (in tracking state), your entire app is alive in the background. You may use any plugin while in the tracking state.

christocracy avatar Nov 16 '18 12:11 christocracy

Hi @christocracy I ran tests and Android works perfectly well, however in iOS does not work, the moment I put the APP in the background (I do not close, I simply minimize) the JS stops responding on time.

Another test was to add the lib react-native-background-timer and use the BackgroundTimer.start(); method, so the application remains alive, however for 4 minutes only, after that JS stops responding as well.

Any idea how I can solve this?

tofoli avatar Nov 19 '18 13:11 tofoli

An iOS app put into the background without location-services engaged will be suspended by the os. There’s nothing you can do about this. Background-timer isn’t going to help you here.

When the background-Geolocation plugin has entered the tracking state (ie: device has moved ~200 meters from last known location), your app is completely alive in the background until the stopTimeout toner expires. During this time, you will be able to sample the accelerometer.

You cannot test this while sitting at your desk, unless you boot your app on your real device with XCode and simulate location with a gpx file.

christocracy avatar Nov 19 '18 13:11 christocracy