Skip to content

Unhandled kCLErrorDomain error 1 on permission change #148

@Mordtimer

Description

@Mordtimer

Describe the bug
Unhandled kCLErrorDomain error 1 cannot be handled properly when user change system permission when stream subscription is active. The same issue occures when I use CurrentLocationLayer() without giving it custom positionStream.

To Reproduce

Bad behaviour (https://github.com/tlserver/flutter_map_location_marker/blob/main/example/lib/page/default_stream_example.dart):

LocationMarkerDataStreamFactory().fromGeolocatorPositionStream().asBroadcastStream().listen(
            (el) => print(el.toString()),
      )
        ..onError((err) {
          print(err.toString());
        });

Proper behaviour with different stream:

          Geolocator.getPositionStream().listen(
            (el) => print(el.toString()),
          )..onError((err) {
            print(err.toString());
          });

Expected behavior
The error should be catchable using onError(), just like in a direct stream from Geolocator

Smartphone:

  • iPhone13
  • OS: iOS 18.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions