Location sensor resolution and background capability

Hello,
I would like to use the location sensor to alert me when I am a certain distance from a particular address. I have a couple of questions

  1. Can the location sensor work of the app is not opened?
  2. What is the minimum distance it needs to recognize a change?
    Thanks
  1. No
  2. I don’t believe there is a minimum distance. But there is a setting on the location sensor for maximum age. This refers to the amount of time that goes by between readings. So if you set maximum age to 5000 (5000 milliseconds = 5 seconds) and get the device location again after only 4 seconds, it will use the previous value. If you instead wait 6 seconds and get the device location, it will update to a new location value.
2 Likes

Thank you

Had another basic question - once we set the maximum age, we have to call getcurrentlocation to get a new position

I mean that as a question

Yes, correct. The location sensor will not automatically generate data. You have to call it each time but you can add it to a loop or timer.

Thanks. And the loop can be added in the opening screen? Sorry to bother you so much

You can place a loop anywhere you like such as inside a when screen opens block.

Thanks. That helps a lot

Is there any way for an alert to be shown when app is ope but in background?

I believe you can use One Signal for that. I haven’t tried it myself, though.