Post

Replies

Boosts

Views

Activity

Multiple widgets, only some with location permissions
I want to implement a bundle of Widgets, some that require location permission and some that do not. In https://developer.apple.com/documentation/widgetkit/accessing-location-information-in-widgets they say If your app provides multiple widgets and only some of the widgets use location, separate your widgets into multiple extensions. Add the NSWidgetWantsLocation to the extension that contains widgets that use location. This allows the system to only prompt the user for the widgets that use location information, and makes it more contextually relevant for users. For more information, see the Declare Multiple Widgets in Your App Extension section in Creating a Widget Extension. But this page, and the section on the referenced "Creating a Widget Extension" page doesn't describe exactly how to do this. Am I supposed to create a "main" Widget Extension, that imports other WidgetExtensions, and the "main" extension declares the WidgetBundle? Or can I just create multiple (isolated) Widget Extensions in my app, and they will all be grouped in the widget selector?
2
0
893
Nov ’20