New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JobIntentService has been deprecated #2571
Comments
I'd suggest updating the README with this information. So telling users that this plugin is deprecated, and they should use workmanager instead. We can keep the plugin around and up-to-date for legacy purposes, until the day Android drops the API officially. |
No, you misunderstand. This plugin is not deprecated. Only the The android docs suggest to use WorkManager instead so one way to resolve this issue would be to just replace Another option I think would be to not use any background runner at all, just run the job directly inside the broadcast receiver and update the README to instruct the uses that if they want to run long running job they should schedule it on the background themselves. One convenient way to do that is to use the workmanager flutter plugin. Also, the workmanager plugin is not a replacement for android_alarm_manager_plus. The reason is that workmanager can run the jobs only while the app itself is running (in the foreground or in the background) but android_alarm_manager_plus can run them even when it's not which is useful in some cases. |
Btw, I'd be happy to create a PR, just wanted to agree on the approach first. |
My understanding is that the I am not sure if just using a broadcast receiver can do that. I think you still need some sort of background service managing the Flutter isolate, or can that be done directly in the broadcast receiver? |
Hm, I guess the broadcast receiver would have to initialize the flutter executor for each received intent (because I don't think it's state is preserved between invocations) which is not ideal. In that case I'd just go with replacing |
Yep, I was thinking the same. Still Alarms are scheduled like before, but the isolate is managed by a workmanager service. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days |
Platform
Android
Plugin
android_alarm_manager_plus
Version
3.0.4
Flutter SDK
3.16.8
Steps to reproduce
JobIntentService
has been deprecated. The android reference suggest to use WorkManager instead.However, perhaps running background jobs shouldn't even be the concern of this plugin? Maybe it should just run the callback directly inside the broadcast receiver and if people need to run long running task they can spawn them themselves using the workmanager plugin or similar?
Code Sample
No response
Logs
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean
The text was updated successfully, but these errors were encountered: