BrowserLocationPermissionRequester

Observes and requests browser geolocation permission.

BrowserLocationProvider delegates LocationProvider.permission and LocationProvider.requestPermission to an instance of this class. Construct one with a CoroutineScope to back a custom LocationProvider, or use rememberBrowserLocationPermissionRequester to bind permission observation to the composition.

Constructors

Link copied to clipboard
constructor(coroutineScope: CoroutineScope)

Creates a requester whose permission observation runs in coroutineScope. Cancelling the scope stops the observation.

Properties

Link copied to clipboard

Whether the browser has a usable Geolocation API.

Link copied to clipboard
val status: StateFlow<LocationPermission>

Current foreground location permission.

Functions

Link copied to clipboard

Starts a foreground permission request and returns immediately.