You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using flutter_local_notifications (a different package) to create a foreground notification associated with an isolate in my Android app, but isolates are not separate processes / services, so really the foreground notification seems to keep the entire app process alive, which may be wasteful, and isn't always reliable.
So I thought that I'd create two ways to communicate with an isolate or service depending on the platform, using flutter_foreground_task for Android. Depending on potential features in this package, it could be pretty easy, or more complex than I originally thought.
The requested feature is to be able to dynamically remove this package's sticky notification while allowing the service to continue running as a background service. When hiding the notification, it would tie the lifetime of the service with the lifetime of the rest of the app. Re-showing the notification would also persist the service as being foreground again.
The main benefit of such a feature is that occasionally turning all notifications off via my app's internal settings allows Android to save battery by closing the app when the user doesn't need to see them.
My app needs its back end to be active at least all the time that the app is running. So, without the proposed feature, I may have to create a class that proxies requests, and stops, starts, and switches between back ends, one being an internal isolate, and the other being a foreground service created via this package.
Although that could work as a a workaround, it wouldn't be as ideal as being able to dynamically control the life cycle of the service. Would switching between a foreground and background service be something you'd be willing to add to your package?
The text was updated successfully, but these errors were encountered:
Thank you for
flutter_foreground_task
!I was using
flutter_local_notifications
(a different package) to create a foreground notification associated with an isolate in my Android app, but isolates are not separate processes / services, so really the foreground notification seems to keep the entire app process alive, which may be wasteful, and isn't always reliable.So I thought that I'd create two ways to communicate with an isolate or service depending on the platform, using
flutter_foreground_task
for Android. Depending on potential features in this package, it could be pretty easy, or more complex than I originally thought.The requested feature is to be able to dynamically remove this package's sticky notification while allowing the service to continue running as a background service. When hiding the notification, it would tie the lifetime of the service with the lifetime of the rest of the app. Re-showing the notification would also persist the service as being foreground again.
The main benefit of such a feature is that occasionally turning all notifications off via my app's internal settings allows Android to save battery by closing the app when the user doesn't need to see them.
My app needs its back end to be active at least all the time that the app is running. So, without the proposed feature, I may have to create a class that proxies requests, and stops, starts, and switches between back ends, one being an internal isolate, and the other being a foreground service created via this package.
Although that could work as a a workaround, it wouldn't be as ideal as being able to dynamically control the life cycle of the service. Would switching between a foreground and background service be something you'd be willing to add to your package?
The text was updated successfully, but these errors were encountered: