flutter_foreground_service_plugin
What is this plugin?
This plugin lets you create a foreground service in Android.
Tested devices:
- Android 8, OxygenOS 5.0.8
- Android 8 (emulator)
- Android 6 (emulator)
Caution:
- I have no idea what will happen if you try to run this plugin on IOS (I can't check this because I am not own any apple product its probably will crush your app)
- Some android operation systems have a strong battery optimization which sometimes kills foreground services, to handel this the plugin will automatically restart the service
What can you control?
- Set the notification content:
- title
- body
- icon
- sub text
- enable / disable sound
- enable / disable vibration
- color
- Set the notification channel content:
- id
- name
- description
- importance
- lockscreen visibility
- Refresh the notification content
- Execute a task inside the service (runs even when the app is closed)
- Start service on boot automatically
App example: