Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getCurrentPosition ignores maximumAge and returns stale locations #113

Open
rayneram opened this issue Jun 15, 2018 · 2 comments
Open

getCurrentPosition ignores maximumAge and returns stale locations #113

rayneram opened this issue Jun 15, 2018 · 2 comments

Comments

@rayneram
Copy link

Environment

  • Plugin version: 1.8.0
  • Platform: iOS
  • OS version: 11.4
  • Device manufacturer / model: iPhone 6S
  • Nativescript version: 4.1.0
  • Plugin config: See attached log file

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

@christocracy
Copy link
Member

christocracy commented Jun 28, 2018

Try latest version 1.9.0-beta.2. Note this is a significant refactor. You might want to review the README.

@christocracy
Copy link
Member

1.9.0-beta.3 released now. Be sure to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants