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.

`getCurrentLocation` not working on IOS without timeout

See original GitHub issue

On IOS, if the timeout is not set (default to infinity), the callback will never get called.

I looked into the native code, and I noticed that the recent v5.2.0 changed from locManager.requestLocation() to locManager.startUpdatingLocation(), which is also the root cause. I tried to revert the change, and everything works fine again.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:13
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
mike-skwicommented, Feb 19, 2021

Ran into this same thing today. Noticed when my callback wasn’t happening until I added a timeout in the config

2reactions
harshvitracommented, Mar 7, 2021

Yes I am also facing the same trouble, if I remove the maximumAge it works

Read more comments on GitHub >

github_iconTop Results From Across the Web

navigator.geolocation.getCurrentPosition( ) not woking in IOS
HI , we are using navigator.geolocation.getCurrentPosition(locationSuccess, locationError, {timeout: 5000} to get logged in user location ...
Read more >
`navigator.geolocation.getCurrentPosition()` hangs on iOS PWA
getCurrentPosition (resolve, reject, { timeout: 5000, maximumAge: 2000 ... navigator is not standalone , and will therefore work as intended.
Read more >
react-native-geolocation-service - npm
React native geolocation service for iOS and android. Why ? This library is created in an attempt to fix the location timeout issue...
Read more >
react-native-geolocation-service Code Examples - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
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 >

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