Replies: 1 comment 3 replies
-
There is weird submodule in your repo so I can see the code. Jobs are transient, however, they work with a concept in Shiny called stateful services. If you make you job an INPC like a viewmodel, those values will automatically be restored each time the job is run. You can take a look here: https://github.com/shinyorg/shiny/blob/dev/src/Shiny.Jobs/Job.cs <= you can also just inherit this. It has a LastRunTime property. Is this what you're using? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have some mostly static data that I want to download from our server and store in our app local db. A Shiny Job sounds like the right tool.
We are currently adding this to our Xamarin Forms app using Shiny 3.2.4 and XF 5.0.0.2662.
With RunOnForeground defaulting to false I went with that:
I know the Job is being registered because I can do the following
If is set RunOnForeground to true:
The background job in the repro project just sends a local notifcation. The ultimate goal is to make an anonymous web requests and write to a local db.
As per the Shiny docs (for MAUI) and the Shiny source I wanted to stash the run time of the Job and then refer to it at its next run time. For now I wanted to display that run time in the notification. Later I would use it to just ignore runs that come too soon after last. However the last run time is always Null and I'm assuming that is because each time the job runs it is a new instance rather than a singleton.
Have I registered it incorrectly?
I have copied some of the setup from the AppBuilder which might hjave been a mistake because that is understandibly targetting the Shiny MAUI libraries
Repro
https://github.com/munkii/ShinyJobsIssue
Beta Was this translation helpful? Give feedback.
All reactions