[Location Plugin] How to make a mobile device report position at all times

[Location Plugin] How to make a mobile device report position at all times

  
Forge Component
(18)
Published on 26 Sep by OutSystems R&D
18 votes
Published on 26 Sep by OutSystems R&D

I am developing a mobile app that needs to report the position of a mobile device at a specific interval (e.g. every hour) not only when the app is running but also when the app is in the background, was quit by the user or even when it has been purged from memory by the the OS (iOS or Android). I know I can use the Location Plugin to get locations when an app is running, the problem is somehow creating a background process that keeps reporting a location all the time, even when the app was quit. Any ideas how to do this with Outsystems? Any existing examples?

Hey, Frans,

Remco's suggestions (especially the second one) look pretty good.

Would you give them a try and tell us how it went? Be careful about battery drain (especially on iOS)!

Best regards,

Carlos Simões

Hi Everyone,

Thanks for the quick response. I think the background location plugin can do what I want. I'm going to give it a try. Hope to let you know how it went sometime next week.


Hi Frans, 

Which route did you take on this? I am faced with the same problem.

Tjaart Swanepoel wrote:

Hi Frans, 

Which route did you take on this? I am faced with the same problem.

Well, we couldn't get the background location plugin from the second link, as it was available at the time, to work. So, we searched some more on github, found a simple background location service project that allowed getting a location in the background at settable intervals, made a fork and wrapped that in an Outsystems module, creating our own plugin as it were. It mostly does what we want, but we have reliability issues on some Android devices and we haven't yet figured out how to make the background process restart when a user force-quits the app or reboots his phone.

I've noticed there is a new version of the background location plugin, but we haven't tried that one yet.


Hi Frans, 

Do you perhaps have a link to the GitHub u used for this problem or would you mind sharing your plugin? 

I currently face the same problem where I need to fetch the users location and the background location plugin still doesn't work. 

Frans Moquette wrote:

Tjaart Swanepoel wrote:

Hi Frans, 

Which route did you take on this? I am faced with the same problem.

Well, we couldn't get the background location plugin from the second link, as it was available at the time, to work. So, we searched some more on github, found a simple background location service project that allowed getting a location in the background at settable intervals, made a fork and wrapped that in an Outsystems module, creating our own plugin as it were. It mostly does what we want, but we have reliability issues on some Android devices and we haven't yet figured out how to make the background process restart when a user force-quits the app or reboots his phone.

I've noticed there is a new version of the background location plugin, but we haven't tried that one yet.