cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
550 stars 674 forks source link

[activity_recognition_flutter 4.0.4] Foreground service always starts #409

Open koenniem opened 3 years ago

koenniem commented 3 years ago

Device / Emulator and OS

On Android only.

Describe the bug

Passing along the argument runForegroundService = false still results in a foreground service. This is because the argument in ActivityRecognitionFlutterPlugin.java:87 is ignored. I fixed this in PR #408 .

To Reproduce

Run the plugin example and change

void _startTracking() {
    activityStream =
        activityRecognition.startStream(runForegroundService: false);
    activityStream.listen(onData);
  }

Expected behavior

Activity recognition without a foreground service

Actual behavior

A foreground service started running

AlirezaDaryani commented 3 years ago

I fixed this issue in #404 .

koenniem commented 3 years ago

I noticed that too, thanks for the fix! Yet, I wanted to create a separate issue and PR in case your entire PR would be rejected and then this issue would be forgotten.

AlirezaDaryani commented 3 years ago

Nice, I mention my PR bcz I add some extra features (Title and body for foreground notification) and fix your mentioned bug,so people can use it. I will be happy to contributing together on it :)

0ttik commented 2 years ago

PR is merged, maybe close this?