Specify Constraints for running background task
See original GitHub issueThe job scheduler allows you to specify a few constraints based on which the task would be run such as network connectivity status, whether the device is charging or not ,etc. Is there a way to specify that here?
Your Environment
- Plugin version: 2.4.3
- Platform: Android
- OS version: 8.0
- Device manufacturer / model: N.A.
- React Native version (
react-native -v
): 0.55.4 - Plugin config : N.A.
Expected Behavior
I would like to be able to specify a few constraints for running the background task periodically,
Actual Behavior
Not sure how it is currently done and would like to know how it can be done.
Context
I am trying to start a background sync every 2 hours but would like the task to only be started if the user is connected to the internet.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Support your app with background tasks - UWP applications
Background task resource constraints ... Background tasks are lightweight. Keeping background execution to a minimum ensures the best user ...
Read more >Define work requests | Android Developers
The WorkRequest object contains all of the information needed by WorkManager to schedule and run your work. It includes constraints which must be...
Read more >How to run background tasks in Flutter using WorkManager
Some Constraints If you set durations under 15 minutes it will be automatically overwritten by Android. Sometimes background tasks can even run ......
Read more >WorkManager in Android: Enqueue and execute background ...
Like JobScheduler, but better, the WorkManager API makes it easy to specify deferrable, asynchronous tasks and indicate when they should run.
Read more >Creating battery friendly background tasks on Android
With WorkManager, you might also choose to run tasks under certain constraints. For example, you might want a particular task to run when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Exactly
I didn’t close it.