Plugin running in low-power mode (desiredAccuracy=1000) but occasionally needing to return an accurate, current position for the device. getCurrentPosition is being used to do this.
Expected Behavior
By providing a config of {timeout:60, maximumAge:5000, desiredAccuracy:100, samples:100} to getCurrentPosition, the method should return and persist a single location that is no older than 5 seconds and has an accuracy equal or better to 100m.
Actual Behavior
getCurrentPosition returns the first location that satisfied the desiredAccuracy parameter irrespective of maximumAge. This means it frequently returns the stale location which is provided initially by Location Manager and does not continue to wait for a more current one.
Debug logs
Attached log demonstrates this behaviour with a test app that calls getCurrentPosition every two minutes. On each occasion, the API returns an old location rather than waiting for Location Manager to provide a current one.
Environment
Context
Plugin running in low-power mode (desiredAccuracy=1000) but occasionally needing to return an accurate, current position for the device. getCurrentPosition is being used to do this.
Expected Behavior
By providing a config of {timeout:60, maximumAge:5000, desiredAccuracy:100, samples:100} to getCurrentPosition, the method should return and persist a single location that is no older than 5 seconds and has an accuracy equal or better to 100m.
Actual Behavior
getCurrentPosition returns the first location that satisfied the desiredAccuracy parameter irrespective of maximumAge. This means it frequently returns the stale location which is provided initially by Location Manager and does not continue to wait for a more current one.
Debug logs
Attached log demonstrates this behaviour with a test app that calls getCurrentPosition every two minutes. On each occasion, the API returns an old location rather than waiting for Location Manager to provide a current one.
NSGL-Log1.txt