flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

iOS 18: Slow in getting a position from getPositionStream

Open Ellynnn opened this issue 4 months ago • 4 comments

Recently I have been receiving numerous feedback that it's difficult to detect location and when I tried debugging, it seems that getPositionStream is very slow in returning a value. I have tested on iOS 17 and iOS 18, it was fast on iOS 17 (almost immediate) but it takes a long time on iOS 18 (may exceed a min). However, on third party apps (Waze, Google Map) for both version, the location updates seem to be working fine.

I was wondering am I the only one experiencing this?

Ellynnn avatar Aug 08 '25 01:08 Ellynnn

Not only does it happen on iOS, but I have also found the same issue on Android, where sometimes it takes as long as 10 minutes to get a correct location update even with distanceFilter=0.

ZTMIDGO avatar Sep 10 '25 02:09 ZTMIDGO

same here

RafaelRV4rgas avatar Sep 22 '25 14:09 RafaelRV4rgas

@Ellynnn @RafaelRV4rgas

I encountered this issue as well. In my case, the problem was related to using background location tracking on iOS. When my app was actively tracking GPS in the background, attempting to get coordinates using the geolocator in the foreground would take 1-2 minutes, sometimes stretching up to 5 minutes.

My solution was to use getLastKnownPosition() to retrieve the last available coordinates and then call the streaming version instead of getCurrentPosition(), which improved the situation somewhat. Additionally, when I paused or stopped the background GPS tracking service, getCurrentPosition() would respond much faster and more accurately.

Perhaps you're experiencing a similar issue - might be worth checking if you have any background location services running. This approach helped resolve my problem.

axmadjon avatar Oct 03 '25 04:10 axmadjon

@axmadjon I'm already using the streaming version instead of getCurrentPosition(). It's weird that i keep getting feedback from users that their location cannot be detected but when i try on my side, it doesn't seems to have any issues at all

Ellynnn avatar Nov 03 '25 02:11 Ellynnn