React-native-background-geolocation: QUESTION: Is it possible to send the accelerometer information?

Created on 14 Nov 2018  路  5Comments  路  Source: transistorsoft/react-native-background-geolocation

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

question

All 5 comments

Not currently.

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

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

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.

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?

An iOS app put into the background without location-services engaged will be suspended by the os. There鈥檚 nothing you can do about this. Background-timer isn鈥檛 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.

Was this page helpful?
0 / 5 - 0 ratings