Dev-hwang / flutter_foreground_task

This plugin is used to implement a foreground service on the Android platform.
https://pub.dev/packages/flutter_foreground_task
MIT License
140 stars 105 forks source link

Add my package replaced intent as option when to reboot foreground se… #219

Closed maxbodelier closed 3 months ago

maxbodelier commented 4 months ago

This PR will add the option autoRunOnMyPackageReplaced field to the ForegroundTaskOptions. By default this value will be set to false, so it is always optional for the user to use the feature.

This feature has been created because when the App using the foreground service is (auto)updated from the store, the foreground service is shut down. This is not the desired behaviour for some apps. Now it is possible to listen to the MY_PACKAGE_REPLACED intent. This intent is fired when the app which is using the foreground service is updated.

Refactors: