Configuring Your Intents UI App Extension Target
Configure your Xcode project to include an Intents UI app extension that you use to customize the Siri and Maps interfaces.
Overview
An app may have one or more Intents UI app extensions to manage the custom interfaces for its intents. Each extension has a single view controller class that provides the interface for the supported intents. To set up each Intents UI app extension, you must add a custom target to your Xcode project and configure its Info.plist file with the intents that it supports.
Add an Intents UI App Extension to Your Xcode Project
When creating your Intents app extension, you can ask Xcode to create an Intents UI extension at the same time. If you didn’t do that, you can add an Intents UI extension to your project later:
Open your iOS app project in Xcode.
Choose File > New > Target.
Select Intents UI extension from the iOS Application Extension group.
Click Next.
Specify the name of your extension and configure the language and other options.
Click Finish.
The Xcode template includes a storyboard and a single view controller. Siri and Maps always load and display the initial view controller in your extension’s storyboard file, so configure that view controller with your content. You’re responsible for managing all interactions between the initial view controller and the rest of your content. Typically, you add custom views to the initial view controller scene, but you might also embed child view controllers so that you can display different content for each of your intents.
Specify the Intents that Your Extension Supports
After adding your Intents UI app extension target to your project, configure the default Info.plist file provided by Xcode to specify which intents should use your custom interface. SiriKit uses the information in your extension’s Info.plist file to determine when to load your custom view controller.
In Xcode, select the
Info.plistfile of your intents app extension.Expand the
NSExtensionandNSExtensionAttributeskeys.In the
IntentsSupportedkey, add a String item for each intent that your extension handles. Set the value of each item to the class name of the intent.
The NSExtensionMainStoryboard key in your Info.plist file contains the name of the storyboard containing your view controller. If you change the name of your storyboard file, remember to update the value of this key. If you prefer to create your view controller programmatically, replace this key with the NSExtensionPrincipalClass key, and set the value to the name of your view controller class.
See Also
Articles
Adding User Interactivity with Siri Shortcuts and the Shortcuts AppDefining Relevant Shortcuts for the Siri Watch FaceDeleting Donated ShortcutsDispatching intents to handlersImproving Siri Media Interactions and App SelectionImproving interactions between Siri and your messaging appRegistering Custom Vocabulary with SiriKitConfirming the Details of an IntentHandling an IntentResolving the Parameters of an IntentGenerating a List of Ride OptionsHandling the Ride-Booking IntentsDonating ReservationsSpecifying Synonyms for Your App NameIntent Phrases