We are using BGContinuedProcessingTask on iOS 26 for long-running background video compression and upload.
This work usually takes about 30 minutes to 1 hour. In testing on physical devices, expirationHandler is invoked irregularly. In some cases, it seems like it is caused by total task duration, and in other cases, it seems related to system resource conditions such as CPU, memory, or battery. However, even after many experiments, we have not been able to find a clear or consistent pattern.
The important problem for us is that we cannot tell why expirationHandler was called. From the app’s perspective, we need to handle the following cases differently:
- the user taps Stop in the Live Activity
- the system expires the task due to time expiration
- the task is terminated due to system resource pressure (CPU, memory, battery, etc.)
- other system-driven termination cases
However, at the moment, it is difficult or practically impossible to distinguish these cases reliably.
My questions are:
- In the context of BGContinuedProcessingTask, is it correct to think that expirationHandler may be triggered by reasons such as time expiration, system resource pressure, and user stop?
- If so, is there any official or supported way for the app to distinguish between these reasons?
- For long-running work such as video compression and upload, is it expected behavior that expirationHandler is invoked irregularly?
- If BGContinuedProcessingTask is not a stable approach for 30-minute to 1-hour background work, is there any other recommended or more reliable way to perform this kind of long-running background processing on iOS without unexpected interruption?
Environment: iOS 26, physical device