Can an app have multiple widget extensions?

Is there a problem with an app having more than one widget extension?

I previously had two 'Today View' extensions that I'm replacing but after installing the app on device with two widget extensions, I'm only seeing the second one in the widget picker.

I see that there's WidgetBundle but my two widgets have very different datasets so the timeline stuff won't mesh.
I was able to get multiple widget extensions working (the docs do mention that is supported), they all appear in the same location in the widget picker (e.g. like the Stocks widget has a 4th page with the Symbol widget).

I did notice a small caveat though, you can either have multiple single widget extensions, or one extension with a WidgetBundle.
In the case there are multiple extensions and one of them defines a WidgetBundle, you'll only see widgets from one of the extensions.

I wonder if this behaviour is by design.


Accepted Answer
I would generally encourage using a WidgetBundle over having multiple extensions. You can keep all the same organization in your project, but there's one less target to manage. Using WidgetBundle does not require using the same TimelineProvider (or even having any shared code at all) between the widgets in the bundle.

That said, I would expect providing two extensions to work. If you're seeing unexpected behavior please let us know by reporting an issue with Feedback Assistant (and include the diagnostic files). Thanks!
It seems that having multiple extensions also causes some of them not load after app install or update. Restarting the iPhone works.

Is there a migration procedure to go from multiple extensions to a bundle? It seems that bundle identifiers are used to know which widget it shown so going from one to other would cause a very poor user experience.

It is recommended to use WidgetBundle instead of creating multiple extensions. In Xcode14, I create two extensions, one of them will not be displayed. Use WidgetBundle All the problems go away

Can an app have multiple widget extensions?
 
 
Q