flutter_background_service icon indicating copy to clipboard operation
flutter_background_service copied to clipboard

Remove foreground notifiction after kill app

Open rsulab opened this issue 2 years ago • 4 comments

Hello.

how we can remove initial foreground notifiction when close app via swipe?

rsulab avatar Jun 09 '23 11:06 rsulab

if the service is programmatically killed by invoking stopService it works but if the user himself removes apps from a recent app list there is no way to remove the notification from the bar Stuck with this problem

innovatoraakash avatar Jun 13 '23 10:06 innovatoraakash

if the service is programmatically killed by invoking stopService it works but if the user himself removes apps from a recent app list there is no way to remove the notification from the bar Stuck with this problem

yea - may be need make some loop in service that will ask main app and if no response kill yourself?

rsulab avatar Jun 13 '23 13:06 rsulab

Well, my solution - app send heartbeat(using dart:async:Timer) message to foreground service each 10 sec and if service don`t receive this message in other 10 sec - kill yourself.

rsulab avatar Jun 16 '23 10:06 rsulab

@rsulab , can you give me example?Currently i am facing same issue.

Kesmi avatar Jun 29 '23 10:06 Kesmi