Unofficial archive. This is a read-only, community-run archive of the Apple Support Community. It is not affiliated with or endorsed by Apple Inc.

Dynamically control iOS widget visibility based on app login status

Hi everyone,

I’m developing an iOS app and would like to know if it’s possible to dynamically show or hide a widget in the iOS Widget Gallery based on the user’s login status in the app.

For example:

  • When a user logs in to the app, the widget should appear in the Widget Gallery.
  • When the user logs out, the widget should be hidden or removed from the Widget Gallery.

Is this behavior supported by iOS? Can an app dynamically control the visibility or availability of its widget in the Widget Gallery based on the user’s authentication status?

If this is not directly supported, is there an alternative or recommended approach using WidgetKit?

Any guidance or suggestions would be appreciated.

Thank you!

2 replies

You'd be better off posting on the developer boards.


forums


It would also help you get responses if you explained why you want to do this. As a user, this looks like a pretty annoying behaviour and I wouldn't use an app that only made the widget show if I was logged in.

Since my app has multiple widgets, some of them specifically require users to log in before they can be used. That’s why I wanted to implement this kind of behavior.