How to create widgets with new app intents?
Generated on 8/4/2024
1 search
To create widgets with new app intents, you can follow these steps:
-
Define the Configuration Intent: This is an intent that conforms to
WidgetConfigurationIntent
. It needs to have a title and parameters that allow for customization. For example, if you want your widget to be configurable with a specific entity like a trail, you can add a parameter for it. -
Set Up the Widget: Use the configuration intent in your widget's body. This involves setting the configuration intent type for the widget and ensuring that the parameters are correctly defined and optional if necessary.
-
Interactive Widgets: With the new capabilities, you can create widgets with multiple interactive areas that perform actions and update state directly within the widget. This includes using buttons and toggles to perform actions without leaving the widget.
-
Relevant Contexts: Specify relevant contexts such as time of day, location, or routine to ensure that your widget appears in the smart stack at the most useful times.
For more detailed guidance, you can refer to the session Bring your app’s core features to users with App Intents (17:02).
Additionally, the session What’s new in watchOS 11 (05:01) discusses how to bring interactive widgets to watchOS using the same APIs as on iOS and macOS, which might be useful if you're targeting multiple platforms.
Platforms State of the Union
Discover the newest advancements on Apple platforms.
Design App Intents for system experiences
App Intents power system experiences in controls, Spotlight, Siri, and more. Find out how to identify the functionality that’s best for App Intents, and how to use parameters to make these intents flexible. Learn how to use App Intents to allow people to take action outside your app, and see examples of when to navigate into your app to show contextual information.
Bring your app’s core features to users with App Intents
Learn the principles of the App Intents framework, like intents, entities, and queries, and how you can harness them to expose your app’s most important functionality right where people need it most. Find out how to build deep integration between your app and the many system features built on top of App Intents, including Siri, controls and widgets, Apple Pencil, Shortcuts, the Action button, and more. Get tips on how to build your App Intents integrations efficiently to create the best experiences in every surface while still sharing code and core functionality.
What’s new in watchOS 11
Explore new opportunities on Apple Watch, including bringing Double Tap support to your watchOS app, making your Smart Stack widgets even more relevant and interactive, and displaying your iOS Live Activities in the Smart Stack.