You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[***] Using Dispatchers.Main here instead will trigger the warning:
[CoreLocation] This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the -locationManagerDidChangeAuthorization: callback and checking authorizationStatus first.
The text was updated successfully, but these errors were encountered:
heldercorreia
changed the title
Docs don't mention that on iOS geolocation needs to be done on a thread with a run loop (typical main thread)
Docs don't mention that on iOS geolocation needs to be done on a thread with a run loop
Feb 13, 2025
I'm new to iOS and expected that calling this inside a suspend function launched in Dispatchers.IO:
would simply work on iOS just like it does on Android.
It turns out that on iOS it needs to be done like this:
Otherwise, the app will never return.
There is no mention of these facts in the docs, which can result in great time wasting for people in the same situation like myself.
Source: https://developer.apple.com/documentation/corelocation/cllocationmanager
[***] Using Dispatchers.Main here instead will trigger the warning:
[CoreLocation] This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the
-locationManagerDidChangeAuthorization:
callback and checkingauthorizationStatus
first.The text was updated successfully, but these errors were encountered: