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.

Accepted Reply

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!
  • Seriously need to be able to conditionally show a widget in a widget bundle. I have a use case where we have multiple widgets but I may not want one of the widgets to show for a given type of user. WidgetBundle builder doesn't support conditionals.

  • What if one wants to have a widget with full data protection, but not the other ones? This is a use case where mutilple widget extensions are required?

Add a Comment

Replies

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.


  • I also experienced this. I had 2 extensions and in one of them I used WidgetBundle. And when I added all of my widgets in iPhone, I found that sometimes not all widgets were reloaded when I called WidgetCenter.shared.reloadAllTimelines().

Add a Comment
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!
  • Seriously need to be able to conditionally show a widget in a widget bundle. I have a use case where we have multiple widgets but I may not want one of the widgets to show for a given type of user. WidgetBundle builder doesn't support conditionals.

  • What if one wants to have a widget with full data protection, but not the other ones? This is a use case where mutilple widget extensions are required?

Add a Comment
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.
Post not yet marked as solved Up vote reply of yozy Down vote reply of yozy
  • We've been using a 'trick' to support this of returning an empty array of 'supportedFamilies' when we want to conditionally hide widgets. Seems to work, but with one huge caveat... it seems like the system only reads this value once, then caches it, meaning if something changes while the app is running, the widget won't re-appear/disappear until they restart their phone (or update the app.)

Add a Comment