Our application currently supports Live Activities.
We’re working on adding a new Widget and are weighing some architectural decisions regarding whether we should add it to the same extension target that our Live Activity lives in or create a new extension that would expose it and other widgets we plan to create in the future.
In the Add Support for Live Activities documentation, it suggests adding Live Activity code to the existing widget extension to facilitate code reuse. Beyond code sharing, we’re trying to determine if there are downsides to isolating new Widget(s) into their own extension.
Specifically, we are concerned about process isolation and how a failure/crash in one might impact the other. Assuming they did live in the same extension, we’re hoping to better understand some of the finer details as presented by the following questions:
- If a Widget (e.g., via the
TimelineProvider) causes the extension process to crash, what is the guaranteed behavior for a currently running Live Activity? - Is the relaunch and restoration of a Live Activity after an extension crash guaranteed, or is it best-effort?
- Is there a distinction in crash isolation between a
TimelineProviderfailure and a View rendering crash? Are there any known scenarios where a Widget crash could cause a Live Activity to be permanently dropped? - Does keeping them in the same extension affect the memory budget, or does each 'instance' receive its own allocation?
In short: we're looking to ensure that an issue with a Widget doesn't inadvertently affect a Live Activity (or vice-versa) when they live in the same WidgetsBundle within the same extension and are seeking guidance on whether it makes sense to keep them together or continue down the path of separate extensions in the interest of process safety.
Any pointers to other documentation or known behavior would be greatly appreciated!