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

Call to .current() on iOS can take up to several seconds to resolve #123

Open
sigmadeltasoftware opened this issue Sep 25, 2024 · 0 comments

Comments

@sigmadeltasoftware
Copy link

Hey everyone,

First off thanks for the effort invested into building and maintaining this library!

I'm currently using it in a KMM project and I've noticed that sometimes multiple seconds can pass before (mainly the first) result of the .current() request resolves:

// Example
private val geolocator = Geolocator.mobile()
...
suspend fun getLocationAndMoveCamera() {
  when (val result = geolocator.current()) { // Can take up to several seconds before result is resolved on iOS 
  ...
  }
}

While doing some research I've noticed that this seems to be an issue for some Flutter libraries too:

Baseflow/flutter-geolocator#964
Baseflow/flutter-geolocator#887 (comment)

I've tried doing things like trying to "pre-initialise" the Geolocator (adding and fetching during the DI setup, calling .current() during onCreate(), etc...) but none of these things seemed to make a (big/noticeable) difference.

Is this an anomaly in my setup and/or are there any suggestions you could give me to deal with this?

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

1 participant