flutter_foreground_task
flutter_foreground_task copied to clipboard
how to listen to changes instead of interval
Hi
I am building an app with purpose of getting call history even in background and I want to trigger the service only when phone is making a call (with the help of https://pub.dev/packages/phone_state )
So in my case onEvent getting called by an interval is useless
How can I manage to do that?
If you want to call onEvent only once, set isOnceEvent in ForegroundTaskOptions to true.
@AliEasy please check this solution https://github.com/Dev-hwang/flutter_foreground_task/issues/126