collect

open suspend override fun collect(): LocationInfo?

Collects the device's current location information asynchronously.

This method first checks for location permissions. If permissions are not granted, it launches a permission request activity and suspends until the user responds. If permissions are granted, it retrieves the last known location from the fused location provider.

Return

LocationInfo containing latitude and longitude if successful, null if:

  • Location permissions are denied by the user

  • Location services are disabled

  • No location data is available

  • An error occurs during location retrieval