8.0.0
What's Changed
Full Changelog: 7.0.0...8.0.0
Breaking changes
- Location flow, permission flow and settings flow are now SharedFlow. Using StateFlow is conceptually wrong because it does not necessarily mean the current state. If you used
.value
on the previous flows, you can now usereplayCache.last()
. LocationFetcher.location
is now aSharedFlow<Either<Nel<Error>, Location>>
. It now reports the errors in the left side of theEither
value in case it failed to obtain a location.LocationFetcher.permissionStatus
andLocationFetcher.settingsStatus
are nowSharedFlow<Boolean>
. The old enumsPermissionStatus
andSettingsStatus
are now deprecated.- Removed
LocationFetcher.requestLocationPermissionOnLifecycle
andLocationFetcher.requestEnableLocationSettingsOnLifecycle
configs fromLocationFetcher.Config
. Instead of requesting permissions and setting enablement on their own, it's now requested automatically once the location flows is subscribed to. - Removed the possibility to ask for location indefinitely. We now use (and require) a rationale for asking for location. If user denies the permission once, the rationale is shown and we ask the permission one more time. If the user denies it, we respect the user decision and don't ask again. This is in accordance with Google's best practices and policies on location fetching. The rationale is a
String
passed to theLocationFetcher
builders.
Other changes
- Added
LocationFetcher.shouldShowRationale(): Boolean
. Should return true after user denied location permission once. It's used internally to decide whether to show a rationale to the user before asking for permission again, but it's also exposed as an API.