Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This notification is often added by many Android devices to inform users that an app is running a service in the background. However, if you want to get rid of this notification in your Flutter app, there are a few ways you can do this:

  1. Use a foreground service: Instead of running your service in the background, you can run it as a foreground service. This will display a persistent notification in the notification bar, but you can customize it to show your own icon and message.

  2. Use Flutter's SystemChrome class: You can use Flutter's SystemChrome class to hide the notification bar entirely, which will also remove the "background service running" notification. However, this will remove the notification bar from the screen entirely, not just the single "background service running" notification.

  3. Modify the AndroidManifest.xml file: You can modify the AndroidManifest.xml file for your Flutter app to remove the "background service running" notification. You can do this by adding a "service" tag to your manifest, and including the attribute "android:foregroundServiceType" with the value "none".

Overall, the best approach will depend on your specific use case and requirements. If you need to run a background service, but the notification is causing issues for your app, consider using a foreground service or modifying the AndroidManifest.xml file.