Releases: psteiger/LocationFetcher
9.0.0
8.2.2
8.2.1
Release 8.2.1
- Update
AGPto 7.1.3,Gradleto 7.4.2 - Only collect location from API if user is collecting
LocationFetcher.location. The previous restriction
(only collect ifLifecycle.State>=STARTED) still holds, so the new
logic for collecting from API is:Lifecycle.State>=STARTED- User is collecting
LocationFetcher.location
8.2.0
- Created demo application.
- Removed default values for
LocationRequest. (Fixes bug whereintervalis not respected). - Removed
GPSandNetworkproviders from default providers config. We now only keepFusedprovider by default (which is an abstraction overGPSandNetworkproviders). This gives more expected behavior relating to theLocationRequestconfigs. - Changed
fastestInterval,intervalandmaxWaitTimetypes to Duration instead ofLong. - Other minor changes.
8.1.1
-
Add support for
Fragmentalongside the
already supportedComponentActivityandContext. -
Add builders with support for lazy rationales.
These builders allow building
LocationFetcherpassing in
a rationale producer instead of a rationale string.
This enables the possibility for usinggetStringin
a field assignment in aComponentActivity/Fragment:class MyFragment : Fragment() { private val locationFetcher = locationFetcher({ getString(R.string.rationale) }) { // ... config } }
-
Bump versions:
Kotlin: 1.6.0-RC2 -> 1.6.10
com.android.library: 7.1.0-beta02 -> 7.1.2
kotlinx.coroutines: 1.5.2 -> 1.6.0
play-services-location: 18.0.0 -> 19.0.1
activity-ktx: 1.4.0-rc01 -> 1.4.0
fragment-ktx: 1.4.0-rc01 -> 1.4.1
appcompat: 1.4.0-rc01 -> 1.4.1
lifecycle: 2.4.0 -> 2.4.1
8.1.0
-
Add support for
Fragmentalongside the
already supportedComponentActivityandContext. -
Add builders with support for lazy rationales.
These builders allow building
LocationFetcherpassing in
a rationale producer instead of a rationale string.
This enables the possibility for usinggetStringin
a field assignment in aComponentActivity/Fragment:class MyFragment : Fragment() { private val locationFetcher = locationFetcher({ getString(R.string.rationale) }) { // ... config } }
-
Bump versions:
Kotlin: 1.6.0-RC2 -> 1.6.10
com.android.library: 7.1.0-beta02 -> 7.1.2
kotlinx.coroutines: 1.5.2 -> 1.6.0
play-services-location: 18.0.0 -> 19.0.1
activity-ktx: 1.4.0-rc01 -> 1.4.0
fragment-ktx: 1.4.0-rc01 -> 1.4.1
appcompat: 1.4.0-rc01 -> 1.4.1
lifecycle: 2.4.0 -> 2.4.1
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
.valueon the previous flows, you can now usereplayCache.last(). LocationFetcher.locationis now aSharedFlow<Either<Nel<Error>, Location>>. It now reports the errors in the left side of theEithervalue in case it failed to obtain a location.LocationFetcher.permissionStatusandLocationFetcher.settingsStatusare nowSharedFlow<Boolean>. The old enumsPermissionStatusandSettingsStatusare now deprecated.- Removed
LocationFetcher.requestLocationPermissionOnLifecycleandLocationFetcher.requestEnableLocationSettingsOnLifecycleconfigs 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
Stringpassed to theLocationFetcherbuilders.
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.
8.0.0-alpha08
8.0.0-alpha08
8.0.0-alpha07
8.0.0-alpha07
8.0.0-alpha06
8.0.0-alpha06