I am building a hybrid-app using nativescript and angular that, among other functionalities, should be able to send information about the current location of the user to a server using the geolocation plugin.
Everything works just fine, but I can’t figure out how to keep it sending the locations (5-15 seconds updates) when the users (which will be mainly drivers) take the whole application to the background (to enter a music app for example).
I have tried a lot of different things, but I can’t seem to figure out what I am looking for. More precisely, I don’t know if the options I found solve the aforementioned problem or if they just take the geolocation service and process it in the background (while the app is in the foreground) in order not to interfere with the user interface.
I’d much appreciate if someone could point me in the right direction for both Android and iOS (as in what I should implement so that it works in Android and what to implement so that it works in iOS).
Options I found:
https://www.nativescript.org/blog/using-android-background-services-in-nativescript (i think this is deprecated because of the implementation of worker option)