ioswidgetios-app-extensionwidgetkit

How to properly discontinue a widget on iOS?


I have decided to remove a widget extension from my app. So this particular widget type is no longer supported. So I completely removed the extension from my project, including all the code and the respective target.

Installed Widgets Break After Update

When I now update my app with this new version, the old widgets are still there, but blank because they can't update anymore as there is no more widget extension or code to handle the updates.

Is there any way to

  1. automatically remove all widgets of a given extension from the user's home screen or
  2. at least declare the widget somehow as "deprecated" so the widget only displays a warning message that it's no longer supported?

The Best Thing I Could Come Up With

My emergency plan is to keep the extension in my app for a while, replace the existing widget UI with the warning text and set the supported widget families for this widget to an empty array. This should prevent the widget from appearing in the widget gallery. Then, a couple of months later, when 95% of my users have updated and hopefully read the warning, I can finally delete the widget extension. This is the best idea I could come up with, but it's far from ideal as it will still break for some users who haven't updated yet when I delete the extension.

So is there a robust way to remove a widget extension without breaking the widgets my users have already installed on their home screen?


Solution

  • After submitting a TSI, according to Apple: until now there is no clean way. Springboard is supposed to remove them, but there are still cases where it fails to do so. I submitted a bug report.