Why I can only retrieve current location when already having permission?
I want to handle something in my ViewModel whenever the current location retrieved. But it didn't work at the first time I start the app and approve the permission. Only be able to see some logs after I close and start the app again.
init {
viewModelScope.launch {
locationRepository.location.collect {
Log.d(TAG, it.toString())
My repository to connect the location data source as you can see
class LocationRepositoryImpl @Inject constructor(
private val dataSource:...