Skip to content

feat(location): expose iOS activityType and automatic-pause signal - #1103

Open
sedwo wants to merge 1 commit into
Lyokone:masterfrom
sedwo:master
Open

sedwo wants to merge 1 commit into
Lyokone:masterfrom
sedwo:master

Conversation

@sedwo

@sedwo sedwo commented Aug 7, 2026

Copy link
Copy Markdown

Core Location has two iOS behaviours the plugin never surfaced, both of which matter to apps recording continuous tracks.

CLLocationManager.activityType was left at Core Location's .other default, so an app had no way to describe the kind of movement it is recording. Apple documents the property as a hint for how fixes are acquired and processed: it informs when updates may be paused automatically, and for automotiveNavigation that reported positions may be adjusted towards nearby roads. Adds Location.setActivityType() and the LocationActivityType enum. The call returns the activity type actually in effect afterwards, read back from the native manager, so callers can confirm what was applied instead of assuming it (#602).

locationManagerDidPauseLocationUpdates(_:) was not implemented, so a pause Core Location decided on by itself was only ever visible as an absence of updates, which is indistinguishable from a location stream that has broken. Adds Location.onLocationUpdatesPaused, emitting true on pause and false on resume.

Both are iOS-only: setActivityType returns null and onLocationUpdatesPaused stays empty on Android, macOS and web, which have no equivalent setting. The platform interface gives both members benign default implementations rather than throwing UnimplementedError, so third-party platform implementations keep compiling untouched.

LocationActivityType crosses the method channel by index, so its declaration order mirrors CLActivityType's raw values and is pinned by a test.

Bumps location to 10.1.0 and location_platform_interface to 7.1.0, with CHANGELOG, README and docs updates, unit tests for both packages, and regenerated mockito mocks.

Core Location has two iOS behaviours the plugin never surfaced, both of
which matter to apps recording continuous tracks.

`CLLocationManager.activityType` was left at Core Location's `.other`
default, so an app had no way to describe the kind of movement it is
recording. Apple documents the property as a hint for how fixes are
acquired and processed: it informs when updates may be paused
automatically, and for `automotiveNavigation` that reported positions may
be adjusted towards nearby roads. Adds `Location.setActivityType()` and
the `LocationActivityType` enum. The call returns the activity type
actually in effect afterwards, read back from the native manager, so
callers can confirm what was applied instead of assuming it (Lyokone#602).

`locationManagerDidPauseLocationUpdates(_:)` was not implemented, so a
pause Core Location decided on by itself was only ever visible as an
absence of updates, which is indistinguishable from a location stream
that has broken. Adds `Location.onLocationUpdatesPaused`, emitting `true`
on pause and `false` on resume.

Both are iOS-only: `setActivityType` returns `null` and
`onLocationUpdatesPaused` stays empty on Android, macOS and web, which
have no equivalent setting. The platform interface gives both members
benign default implementations rather than throwing `UnimplementedError`,
so third-party platform implementations keep compiling untouched.

`LocationActivityType` crosses the method channel by index, so its
declaration order mirrors `CLActivityType`'s raw values and is pinned by
a test.

Bumps location to 10.1.0 and location_platform_interface to 7.1.0, with
CHANGELOG, README and docs updates, unit tests for both packages, and
regenerated mockito mocks.
@docs-page

docs-page Bot commented Aug 7, 2026

Copy link
Copy Markdown

To preview the documentation for this pull request, visit the following URL:

docs.page/lyokone/flutterlocation~1103

Documentation is deployed and generated using docs.page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant