Dev-hwang / flutter_foreground_task

This plugin is used to implement a foreground service on the Android platform.
https://pub.dev/packages/flutter_foreground_task
MIT License
140 stars 105 forks source link

Start Foreground Task even if app is closed. #229

Closed JasperElton closed 1 month ago

JasperElton commented 2 months ago

I'm currently working on an app blocking app where users can schedule and set a start time and end time to block apps. I've already implemented android_alarm_manager with flutter_foreground_task to start foreground task on a specific time. My problem is that it seems like starting the foreground task needs the app to be opened to actually start the foreground task. Is there a way to start foreground _task without the app being opened?

Dev-hwang commented 1 month ago

This feature is not supported. But, it seems that the feature can be implemented by registering options on dart side and calling it from native. I will consider adding this feature.