We have a UWP application in which there are 3 registered background jobs, one of them is a trigger application that continues to run in the background until failure.
The approach is to restore the last saved state that is stored in the background processor object, which has not yet worked, it works with data stored until the last moment of background activity, and returns data if the contents of the user interface have not passed (by debugging applications from recent applications).
The only problem is that the main thread is gone and the application must resume activation, the last instance of the application is complete , which means that the background object is gone too, and we cannot restore anything.
Is there a wrong implementation that can cause this, is there a way to prevent this?
Clarification: The background task receives the user's location every 5 seconds and sends it to the server. There are no logs, but using Debug Output I ensured that BGtask worked until the restart, which it paused and stopped. The application trigger starts when the background is entered, and the task is forced to close when the background exits.
Thank.
source
share