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 slow if Precise Location is set to Off on iOS 14 #214

Closed
alexandersandberg opened this issue Oct 21, 2020 · 7 comments
Closed

Comments

@alexandersandberg
Copy link

If Precise Location is set to Off in settings, getCurrentPosition() takes from my testing ~10 seconds to resolve the location.

Happens irregardless of what enableHighAccuracy is set to.

Tested on both simulator and physical device with the same results. Using the master branch.

@Agontuk
Copy link
Owner

Agontuk commented Oct 27, 2020

iOS 14 has added some new functionalities in location. Probably need to expose precise location related options/method from this library. I'll take a look as soon as I can.

@richardli123
Copy link

Thank you Agontuk for creating this package. It has helped me alot as I was using the old geolocation package. Is there any update on this issue as I am also running into it

@JeffAbney
Copy link

@alexandersandberg where exactly is the Precise Location setting you mention? Inside the app's settings or general phone settings?

@alexandersandberg
Copy link
Author

alexandersandberg commented Nov 24, 2020

@JeffAbney This is a new iOS 14 Location Services option for each app, found in device settings.

In the Settings app, you can find it by going to one of the following:

  • {Your App} > Location
  • Privacy > Location Services > {Your App}

IMG_46C6204982C9-1

@NoahFace
Copy link

The cause of this issue is the following in RNFusedLocation.swift:

let locManager = CLLocationManager()
locManager.delegate = self
locManager.desiredAccuracy = getAccuracy(options)
locManager.distanceFilter = distanceFilter
locManager.startUpdatingLocation() //<<<<<<<<<<<<< requestLocation()

If you change requestLocation() to startUpdatingLocation(), IOS location services will start returning location values immediately rather than after 10 seconds. I don't know the code well enough to tell you if this will impact subscriptions,
but if you just want one-off location reads this will fix the issue.

@jbuijgers
Copy link

Am I correct that this one is fixed after 4a9b6ce is released? If so, @Agontuk any plans for a new release? :-)

@Agontuk
Copy link
Owner

Agontuk commented Feb 1, 2021

v5.2.0 has been published with location delay fix.

@Agontuk Agontuk closed this as completed Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants