-
I am registering and later starting a job with the following code:
Sometimes this works perfectly but sometimes I get this message in the output console:
I changed my code to check that the job is registered before running it (even though I am sure the registration is started before the Run call):
But I get the same result, i.e. the GetJob() returns the JobInfo but afterward the error still appears. Am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
If you are calling Run immediately after the the Register, you'll need to await Register as it is async. |
Beta Was this translation helpful? Give feedback.
-
What is the recommended way to register the job on startup? The documentation container this FAQ:
In the jobs sample in GitHub, the sample job is registered together with the services. In my case this is too early as other services are not registered yet. So I want to register them in the app's OnStart method. However, if I make it async (in order to call "await Register"), the app fails to start on iOS with an exception because async methods are not allowed before the UI is shown. |
Beta Was this translation helpful? Give feedback.
If you are calling Run immediately after the the Register, you'll need to await Register as it is async.