You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I need some help to correctly implement a daily background worker on android and other platforms in the future.
Currently I can run the worker as expected with the code below.
My questions are mostly around the implementation of the Worker:
What is the correct way to inject parameters into the actual Worker, like the github username and token or executionTime to schedule the task for the next day?
Is it the suggested way to just instantiate the WorkScheduler and my GitHubGraphQLService or can I inject it via dependency service? If possible how does this actually work when the task is running without the actual app?
How to correctly call async methods inside DoWork() ?
Bonus question: If someone already got an implementation to delete an existing OneTimeWorkRequest via its tag I would happily take a look at it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I need some help to correctly implement a daily background worker on android and other platforms in the future.
Currently I can run the worker as expected with the code below.
My questions are mostly around the implementation of the Worker:
Interface
Android Implementation
Register and call in MauiProgram.cs
Actual Worker
Reference posts for the implementation:
Daily Worker: https://medium.com/androiddevelopers/workmanager-periodicity-ff35185ff006
Maui Android Support WorkManager: #4065
+ some Android Docs
Beta Was this translation helpful? Give feedback.
All reactions