Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically hide iOS widgets?

I have developed an iOS 14 desktop widget for an application and I would like to only make it available to some users. Is there a way to disable widgets the first time your application runs so that you can hide it from some of your users?

like image 521
TALE Avatar asked Jun 16 '26 06:06

TALE


1 Answers

If you set the supportedFamilies modifier on the WidgetConfiguration to [] then the widget no longer shows in the widget gallery. That might be an option.

public var body: some WidgetConfiguration {

IntentConfiguration(
  kind: kind,
  intent: ConfigurationIntent.self, 
  provider: Provider()
) { entry in
  widget_mainEntryView(entry: entry)
}
.configurationDisplayName("Widget")
.description("Widget")
.supportedFamilies([])
}
like image 84
Lokesh Avatar answered Jun 19 '26 07:06

Lokesh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!