flutter_foreground_task icon indicating copy to clipboard operation
flutter_foreground_task copied to clipboard

how to listen to changes instead of interval

Open AliEasy opened this issue 3 years ago • 1 comments

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?

AliEasy avatar Sep 06 '22 07:09 AliEasy

If you want to call onEvent only once, set isOnceEvent in ForegroundTaskOptions to true.

Dev-hwang avatar Sep 30 '22 05:09 Dev-hwang

@AliEasy please check this solution https://github.com/Dev-hwang/flutter_foreground_task/issues/126

samnbd avatar Dec 27 '22 11:12 samnbd