getCurrentLocation

@RequiresPermission(anyOf = ["android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"])
fun getCurrentLocation(listener: LocationService.OnCurrentLocationListener)

Requests a single location update. Returns a cached last known location if it was recently cached or waits until a new location is received if none is already available. Because this method might use cached locations, returned value in callback may not be the most recent one. This method returns immediately and notifies in provided listener when location is found. Current location request can be cancelled by calling cancelCurrentLocation. Once the request is cancelled, provider listener is no longer called. There are no guarantees on which thread the listener will be called on. This will depend on Android version on the device and whether Google Play Services location provider is available or not.