devggaurav / weatherApp-Compose-Multiplatform

A weather app to show weather details in compose multiplatform, KMP
2 stars 2 forks source link

getLastKnownLocation() is null in iOS #5

Open andiosdev opened 2 months ago

andiosdev commented 2 months ago

Hi,

Thanks for this excellent example. I'm new to Compose-Multiplatform and this helped me a lot. In iOS I'm getting this error when calling locationProvider.getLastKnownLocation():

This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the-locationManagerDidChangeAuthorization:callback and checkingauthorizationStatusfirst.

devggaurav commented 2 months ago

Try to call that in coroutine context .