question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getCurrentPosition slow if Precise Location is set to Off on iOS 14

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Agontukcommented, Feb 1, 2021

v5.2.0 has been published with location delay fix.

3reactions
NoahFacecommented, Dec 16, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capacitor Geolocation.getCurrentPosition is very slow in IOS ...
I am using capacitor geolocation plugin to find current location coordinates(latitude and longitude). const coordinates = await Geolocation.
Read more >
Turn Location Services and GPS on or off on your iPhone ...
How to turn Location Services on or off for specific apps · Go to Settings > Privacy > Location Services. · Make sure...
Read more >
geolocator | Flutter Package - Pub.dev
Geolocation plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API for generic location (GPS etc.) functions.
Read more >
iOS 14 lets users grant approximate location access for apps ...
Select the app name and then change the Precise Location switch to on or off, as desired. For apps that you granted location...
Read more >
Geolocation.getCurrentPosition() - Web APIs | MDN
A positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. If set to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found