S
S
SvizzZzy2017-11-03 17:40:43
Android
SvizzZzy, 2017-11-03 17:40:43

Can GPS watchPosition() run in the background on androids?

Greetings.
I tried a lot of different developments like this one: https://www.npmjs.com/package/cordova-plugin-socra...
I just can't get the application to send coordinate data to the server in the background.
In almost all cases, it turns out to send data only once during the minimization of the application, and then the GPS goes out and nothing happens.
Something suggests that it’s possible that it’s impossible to make GPS work in the background at all (namely, watchPosition, that is, constant tracking, send data in the background, for example, every 5 seconds), is that so?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Varakosov, 2017-11-03
@thelongrunsmoke

Currently, this is only possible when starting the service via startForeground().

D
Dmitry, 2018-03-01
@demon416nds

Have you tried calling coordinates via setinterval?
it certainly slows down every 30 times in the background but it works

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question