I have a BGAppRefreshTask that is executing an operation.
The operation calls a custom class that performs some tasks and also initiates a 10 seconds timer that is a timeout fallback in this custom class.
When I make use of the custom class in other context than the background task, the timer is properly executing and the timeout logic is effective.
But in the context of the BGAppRefreshTask, that I'm testing through the XCode "_simulateLaunchForTaskWithIdentifier" command, the Timer is without effect - although returning no error when set.
I'm starting the timer with the following line of code:
RunLoop.current.add(self.timeout_timer!, forMode: RunLoop.Mode.common)
The operation is not being interrupted or cancelled, so I believe both the custom class instance (that contains a function the timer will run when expiring) and the reference to the timer are properly retained.
I wonder if there is a specific limitation, or thread issue in the context of a BGAppRefreshTask.