In my Notification Service Extension I'm doing two things in parallel inside didReceive(_:withContentHandler:):
- Downloading and attaching a rich media image (the standard content modification work)
- Firing a separate analytics POST request (fire-and-forget I don't wait for its response)
Once the image is ready, I call contentHandler(modifiedContent). The notification renders correctly.
What I've observed (via Proxyman) is that the analytics POST request completes successfully after contentHandler has already been called.
My question: Why does this network request complete? Is it because:
(a) The extension process is guaranteed to stay alive for the full 30-second budget, even after contentHandler is called so my URLSession task continues executing during the remaining time?
(b) The extension process loses CPU time after contentHandler but remains in memory for process reuse and the request completes at the socket/OS level without my completion handler ever firing?
(c) Something else entirely?
I'd like to understand the documented behaviour so I can decide whether it's safe to rely on fire-and-forget network requests completing after contentHandler, or whether I need to ensure the request finishes before calling contentHandler.