- [FIX] Resolved frequent ForegroundServiceDidNotStartInTime and ForegroundServiceDidNotStopInTime exceptions by avoiding redundant foreground service start contracts. #377
- [FIX] Prevent crash in onDestroy #372
- [FEAT] Add
allowAutoRestartoption, which enables the service to automatically restart if it is terminated by the system. - [FEAT] Add
stopWithTaskoption, to ensure service termination when the app UI is dismissed. - [FEAT] Add
mediaProcessingforeground service type. - [FIX] Fix
FLAG_STOP_WITH_TASKbitmask check error.
- [FEAT] Support manual foregroundServiceType via serviceTypes in startService
- [CHORE] Bump minimum supported SDK version to
Flutter 3.22/Dart 3.4 - [CHORE] Bump
kotlin_version(1.7.10 -> 1.9.10),gradle(7.3.0 -> 8.6.0)for Android 15 - [FEAT] Add
isTimeoutparam to the onDestroy callback - [FIX] Fix "null object" error #332
- [FIX] Fix "Reply already submitted" error #330
- [FIX] Prevent crash by catching exceptions during foreground service start
- Check migration_documentation for changes
- [FEAT] Allow
onNotificationPressedto trigger withoutSYSTEM_ALERT_WINDOWpermission- Do not use the
launchAppfunction inside theonNotificationPressedcallback - Instead, use the
notificationInitialRouteoption of thestartServiceorupdateServicefunctions
- Do not use the
- [BREAKING] Change
ServiceRequestResultclass tosealed classfor improved code readability - [BREAKING] Change method for customizing notification icon
- [FEAT] Add
copyWithfunction for models reuse - Check migration_documentation for changes
- [FEAT] Support quickboot for HTC devices
- [CHORE] Downgrade iOS minimumVersion from
13.0to12.0
- [FEAT] Add
setOnlyAlertOnceoption to AndroidNotificationOptions pr-#287 - [CHANGE] Change notification channel importance from
DEFAULTtoLOW
- [FEAT] Allow sending
Setcollection usingFlutterForegroundTask.sendDataToMain
- [FIX] Fixed an issue where main function was called repeatedly when there was no callback to start
- [FIX] Handle exceptions that occur when service component cannot be found
- [FIX] Fixed an issue where exception was thrown when flutterEngine failed to start #282
- [FIX] Fixed an issue with flutterEngine not being destroyed properly
- [BREAKING] Change
onStart,onDestroycallback return type fromvoidtoFuture<void>- The onRepeatEvent callback is called when the onStart asynchronous operation has finished
- Now you can access network, database, and other plugins in onDestroy callback #276
- Check migration_documentation for changes
- [CHANGE] Ignore
autoRunOnBootoption when service is stopped by developer - [CHANGE] Ignore
autoRunOnBootoption when android:stopWithTask is set to true - [FEAT] Add TaskStarter to check who started the task #276
- Add
starterparameter toonStartcallback of TaskHandler .developer: The task has been started by the developer (startService, restartService, updateService).system: The task has been started by the system (reboot, app-updates, AlarmManager-restart)
- Add
- [FEAT-iOS] Allow background app refresh
Bump iOS minimumVersion to 13.0- You need to add
BGTaskSchedulerPermittedIdentifierskey inios/Runner/info.plistfile - Check Getting started-iOS for more details
- [DOCS] Update example to see two-way communication flow
- [FIX] Fix issue related to
openIgnoreBatteryOptimizationSettings#275
- [REMOVE] Remove notification permission request code in startService
- Notification permission request is required before starting the service
- Check step-4 of readme
- [FIX-Android] Fix issue with calling onRepeatEvent without waiting for repeat delay after onStart
- If use the
eventAction: ForegroundTaskEventAction.repeat(millis) - flow:
onStart- (millis) -onRepeatEvent- (millis) -onRepeatEvent..
- If use the
- [FEAT] Allow permission settings page to be opened even if permission is granted
- openIgnoreBatteryOptimizationSettings()
- openSystemAlertWindowSettings()
- openAlarmsAndRemindersSettings()
- [BREAKING] Change the way to set the task intervals (for increase scalability)
- Remove
interval,isOnceEventoption in ForegroundTaskOptions model - Add
eventActionoption with ForegroundTaskEventAction constructor - Check migration_documentation for changes
- Remove
- [FEAT] Add
openAlarmsAndRemindersSettingsutility- This utility allows the Android OS to immediately restart service in doze mode.
- required
android.permission.SCHEDULE_EXACT_ALARMpermission. - When you call this function, will be gone to the settings page. So you need to explain to the user why set it.
- Check utility_documentation for more details.
- [FEAT] Add
canScheduleExactAlarmsutility- Returns whether the
android.permission.SCHEDULE_EXACT_ALARMpermission is granted. - In some cases, permission is granted automatically. Don't worry :)
- Returns whether the
- [FIX] Fixed an issue where Map collection could not be cast in onReceiveData #258
- [FEAT] Add showBadge option to AndroidNotificationOptions.
- [DEPRECATED] Deprecated AndroidNotificationOptions.id. Use startService(serviceId) instead.
- [DOCS] Separate models, utility, migration documentation.
- [CHORE-AOS] Down Android minSdkVersion to 21
- [FIX-AOS] Fixed an issue where notification text was not visible on Android 7.1 and below
- [FEAT-iOS] Implement onNotificationButtonPressed
- [FEAT-iOS] Implement onNotificationPressed
- [FEAT-iOS] Implement onNotificationDismissed
- [FEAT-iOS] Implement notification permission request and check function
- Request notification permission in the
Example._requestPermissionsfunction
- Request notification permission in the
- [BREAKING] Redesign the communication method between TaskHandler and UI
- Fixed an issue where
SendPort.senddoes not work when callingreceivePortgetter function after app restart #244 - Allow task data to be listened on multiple pages
- Check migration_documentation for changes
- Fixed an issue where
- [FIX] Fixed an issue that caused poor performance and delays in TaskHandler
- [FIX-iOS] Fixed an issue where onDestroy was not called when an app was closed in recent apps
- [DOCS] Update readme
- Update documentation on how to pass timestamp to UI isolate
- Update
WithForegroundTaskdocumentation comments
- [FEAT] Support notificationText with multiple lines #182
- [REMOVE] Remove
WillStartForegroundTaskwidget- This widget is designed to start a service when the app is minimized.
- This widget had an ambiguous purpose, it caused a lot of problems because the widget controlled the service.
- These issues have led me to remove this widget. Please implement it yourself if necessary.
- [FEAT-Recommended] Improve restart alarm that occurs when the service terminates abnormally
- [FIX] Fixed an issue where notification events were handled on both when using plugin in multiple apps #137
- [FIX] Fixed an issue where the service did not restart when Android OS forcibly terminated the service #223
- [FEAT] Add result class to handle service request errors
- The return value of service request functions changed from boolean to
ServiceRequestResult
- The return value of service request functions changed from boolean to
- [FEAT] Add function to send data to TaskHandler
- You can send data from UI to TaskHandler using
FlutterForegroundTask.sendDatafunction
- You can send data from UI to TaskHandler using
- [FEAT] Add ability to restart service when app is deleted from recent app list
- To restart service on Android 12+, you must allow the
REQUEST_IGNORE_BATTERY_OPTIMIZATIONSpermission
- To restart service on Android 12+, you must allow the
- [REMOVE] Remove
isStickyfrom AndroidNotificationOptions- The isSticky option is automatically set by the service based on the Manifest android:stopWithTask
- [FEAT-Recommended] Allow updateService to be processed without service restart
- [CHORE] Updates minimum supported SDK version to
Flutter 3.10/Dart 3.0 - [BREAKING] Change timezone(local > UTC) of timestamp in TaskHandler callback
- [BREAKING] Remove
iconData,buttonsfrom AndroidNotificationOptions- Can use this options in the startService function
- Check migration_documentation for changes
- [FEAT] Add ability to update notification icon and buttons for Android platform
- [FEAT] Add
onNotificationDismissedcallback for Android 14
- [CHORE] Bump Android minSdkVersion to 23
- [FIX] Fixed an issue where notification actions did not work on Android 14
- [REMOVE] Remove
foregroundServiceTypeoption - [FEAT] Add
autoRunOnMyPackageReplacedoption
- [FEAT]
Add option to allow multiple foregroundServiceType - [DOCS] Update readme
- [FEAT] Support AGP 8
- [FEAT]
AddforegroundServiceTypeoption to specify foreground service type on Android 14 and higher
- [DOCS] Update readme #192
- [CHORE] Remove platform dependency
- [CHORE] Update dependencies
- [FIX] Fix issue where SecurityException occurred when registering runtime receiver #175
- [TEST] Add assertions to service options
- [BREAKING] Remove future return of TaskHandler callback function
- [FIX] Fix issue where isRunningService is not updated after calling onDestroy
- [FIX] Fix storage data not syncing between isolates
- [FIX] Fix the service could not be started when the notification channel information is empty
- [CHORE] Upgrade dependencies - shared_preferences
- [REFACTOR] Move required permissions on the Android platform inside the plugin
- [BREAKING] Rename the callback function to clarify what information the event provides
- Rename
onButtonPressedtoonNotificationButtonPressed - Rename
onEventtoonRepeatEvent
- Rename
- [FEAT] Add textColor option to NotificationButton
- [FEAT] Add ability to change task options while service is running
- [FIX] Fix issue where service could not be started in the background
- [FEAT] Add id option to AndroidNotificationOptions
- [FEAT] The WillStartForegroundTask widget supports receiving data
- [CHORE] Update dependency constraints to
sdk: '>=2.18.0 <4.0.0'flutter: '>=3.3.0' - [FEAT] Add notification permission request func for Android 13
FlutterForegroundTask.checkNotificationPermission()FlutterForegroundTask.requestNotificationPermission()
- [DOCS] Update documentation to the latest version
- [FIX] Fix service not starting when notification permission is denied
- [FEAT] Add notification permission request func for Android 13
- According to the official documentation, starting with Android 13 and higher, you need to request notification permission to expose foreground service notifications.
- In this version, notification permission requests occur when the
startServicefunction is called. - Add
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />permission to yourAndroidManifest.xmlfile.
- [CHORE] Bump Android coroutines version to 1.6.4
- [CHANGE] Change the way get receivePort from asynchronous to synchronous #128
- Can register and get receivePort without starting the service.
- From now on, register receivePort before starting the service. Please check the readme and example.
- [FIX] Fix issue where the results of the service start and stop functions did not match the service status
- [FIX] Fix mounted error #133
- [CHORE] Bump Android Gradle version to 7.1.2
- [CHORE] Update minimum Flutter version to 3.0.0 #130 #131
- [DOCS] Update readme #125
- [FEAT] Add
isOnceEventoption toForegroundTaskOptions.class. - [DOCS] Add
entry-pointpragma. - [REFACTOR] Refactor code using plugin_platform_interface.
- [FEAT] Add
allowWakeLockoption toForegroundTaskOptions.class. - [FEAT] Add
forceOpenoption toopenSystemAlertWindowSettings().
- Fix issue with SharedPreferences won't provide updated data from main isolate while running on background. Thanks @h2210316651
- Fix issue where sendPort returned null when restartService called.
- Upgrade Coroutine library.
- Upgrade shared_preferences plugin.
- Separate the SendPort registration code from the foreground service related functions.
- Register a SendPort object only when the user needs a ReceivePort.
- Please see this page for a modified example.
- [FEAT] Add
isAppOnForegroundfunction.- Returns whether the app is in the foreground.
- This can be used when you want to perform some function when the app is in the foreground.
- [FEAT] Add
setOnLockScreenVisibilityfunction. Thanks @Techno-Disaster- Toggles lockScreen visibility.
- If set to true, launchApp can be run from the lockscreen.
- [#61] Add code to prevent ForegroundServiceStartNotAllowedException.
- [#78] Fix compilation errors for Flutter 3.0.0
- [#62] Fix issues with SharedPreferences.
- Add SYSTEM_ALERT_WINDOW permission request function.
- Provide a way to use notification press handler on Android 10+.
- https://developer.android.com/guide/components/activities/background-starts
- You can use the SYSTEM_ALERT_WINDOW permission to work around the above Restrictions.
- Add notification press handler for Android platform.
- Add sendPort parameter to onDestroy function of TaskHandler.
- Add receivePort getter function.
- Clarify the meaning of the dev message.
- Example updates.
- Upgrade Flutter SDK minimum version to 2.8.1
- Upgrade shared_preferences: ^2.0.13
- Add
backgroundColoroption for AndroidNotificationOptions. - Add
getAllDatafunction. - Fixed the problem that data not related to the service is deleted when clearAllData() is called.
- Fixed the problem that the notification button did not work when using a specific button id.
- Downgrade Android minSdkVersion to 21.
- [#42] Only minimize app on pop when there is no route to pop.
- Upgrade shared_preferences: ^2.0.11
- [iOS] Fixed an issue where notifications not related to the service were removed.
- [iOS] Improved compatibility with other plugins that use notifications.
- Additional settings are required, so please check the Readme-Getting started.
- Add process exit code to prevent memory leak.
- Fix dart formatting issues.
- Upgrade shared_preferences: ^2.0.9
- Can now add action buttons to Android notification.
- [Bug] Fixed an issue where lockMode(wakeLock, wifiLock) was not properly released when the service was forcibly shutdown.
- [Bug] Fixed an issue where foreground service notification UX was delayed on Android version 12.
- Add wakeLock to keep the CPU active in the background.
- Need to add
android.permission.WAKE_LOCKpermission toAndroidManifest.xmlfile.
- Need to add
- Add wifiLock to keep the Wi-Fi radio awake in the background.
- Enable or disable can be set with
allowWifiLockofForegroundTaskOptionsclass.
- Enable or disable can be set with
- Add
requestIgnoreBatteryOptimizationfunction. - Change onWillStart type from
ValueGettertoAsyncValueGetter.
- [Bug] Fixed an issue where IllegalArgumentException was thrown when starting the service on Android version 11 and higher.
- Bump Android minSdkVersion to 23.
- Bump Android compileSdkVersion to 31.
- [Bug] Fixed an issue where RemoteServiceException occurred intermittently.
- [iOS] Fixed an issue where all data stored in
UserDefaults.standardwas removed when the stopService function was called.
- Add
restartServicefunction. You can now restart the service to get the newReceivePort. - Improve service-related function code. A return value has been added to check if the function was properly requested.
- Upgrade shared_preferences: ^2.0.8
- Add
required keywordto parameters of saveData func. - Add
isStickynotification option for Android.
- [BREAKING] The way you start the foreground service and register tasks has changed. Check readme for more information.
- [BREAKING] Change function name from
starttostartService. - [BREAKING] Change function name from
updatetoupdateService. - [BREAKING] Change function name from
stoptostopService. - [BREAKING] Change function name from
isRunningTasktoisRunningService. - Added functions for data management.
- Fixed an issue where notifications were not removed when the service was stopped.
- Fixed incorrect documentation.
- Fixed playSound option not working properly in the background.
- Implement background task on iOS platform. Please check Readme as setup is required.
- Implement a service restart function to deal with unexpected errors.
- Remove
notification_options.dart. - Add
android_notification_options.dart. - Add
ios_notification_options.dart. - Change the
playSounddefault value fromtruetofalse.
- Fixed duplicate call to startForegroundTask function.
- Optimize android native code.
- Add
sendPortparameter to TaskCallback.
- Update README.md
- Fix
callbackHandletype casting error.
- Add utility methods related to battery optimization.
- Add
showWhenoption. - Add
visibilityoption. - Migrate example to null safety.
- Add
autoRunOnBootfield toForegroundTaskOptions. Check the readme for more details.
- Add
onDestroyto clean up used resources in callback functions.
- Change the notification icon setting method.
- Improved the code so that the notification icon is displayed properly even when using the resource shrinker.
- [BREAKING] Remove singleton
instanceofFlutterForegroundTask. - [BREAKING]
TaskCallbackreturn type changed fromvoidtoFuture<void>. - [BREAKING] All functions of
FlutterForegroundTaskare applied as static. - [BREAKING] The way foreground task are registered has changed. See the readme for details.
- Add
printDevLogoption. - Update README.md
- Update Example.
- Add
iconfield toNotificationOptions. - Change the model's
toMapfunction name totoJson.
- Add
FlutterForegroundTask.instance.update()function. - Update README.md
- Fix incorrect comments and documents.
- Add
enableVibrationnotification options. - Add
playSoundnotification options.
- Fix an issue where
RemoteServiceExceptionoccurs.
- Add
WillStartForegroundTaskwidget.
- Fix incorrect comments and documents.
- Add
channelImportancenotification options. - Add
prioritynotification options.
- Add
WithForegroundTaskwidget.
- Initial release.