cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
551 stars 681 forks source link

[carp_background_location:4.0.0] background_locator_2 is also no longer maintained #1025

Open udiedrichsen opened 3 months ago

udiedrichsen commented 3 months ago

Device / Emulator and OS

Please complete the following information for each phone and/or emulator you're experiencing this bug on:

NB: Bugs pertaining to old devices/OS versions will likely not be fixed.

Ok, I am using the 18 beta already but it we be live very soon.

Describe the bug

Its not really a bug, but a hint:

https://github.com/Yukams/background_locator_fixed

This project is no longer actively maintained. If you are interested in becoming a maintainer, please open an issue or contact me directly !

To Reproduce

Check the github repo.

Their are already a big number of open issues.

Expected behavior

Evaluate other packages for background location.

Actual behavior

I got problems when using the mobility_feature package. For the first run it works well, but if the background location service already running it will not receive new features due problems with the background location service.

As a workaround I change the carp_background_location.LocationManager.start method for me:

  Future<bool> start() async {
    if (await isRunning) {
      await stop();
    }

    await BackgroundLocator.initialize();

    await BackgroundLocator.registerLocationUpdate(
      LocationCallbackHandler.callback,
      initCallback: LocationCallbackHandler.initCallback,
      disposeCallback: LocationCallbackHandler.disposeCallback,
      autoStop: false,
      androidSettings: AndroidSettings(
          accuracy: _accuracy,
          interval: _interval,
          distanceFilter: _distanceFilter,
          androidNotificationSettings: AndroidNotificationSettings(
            notificationChannelName: _channelName,
            notificationTitle: _notificationTitle,
            notificationMsg: _notificationMsg,
            notificationBigMsg: _notificationBigMsg,
          )),
      iosSettings: IOSSettings(
        accuracy: _accuracy,
        distanceFilter: _distanceFilter,
      ),
    );

    return await isRunning;
  }

If its already running I call stop and restart it. Not sure if this is a good way, but it works :-)

Screenshots

Flutter doctor

Additional information

I really like your packages, good job 💯