flutter-plugins icon indicating copy to clipboard operation
flutter-plugins copied to clipboard

[activity_recognition_flutter 4.0.4] Foreground service always starts

Open koenniem opened this issue 4 years ago • 4 comments

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

koenniem avatar Aug 31 '21 11:08 koenniem

I fixed this issue in #404 .

AlirezaDaryani avatar Sep 03 '21 13:09 AlirezaDaryani

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.

koenniem avatar Sep 07 '21 10:09 koenniem

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 :)

AlirezaDaryani avatar Sep 07 '21 12:09 AlirezaDaryani

PR is merged, maybe close this?

0ttik avatar Oct 20 '22 05:10 0ttik