Contents

Intent infrastructure

Provide supplemental context for your intents, and create infrastructure to make app intents reusable across your apps.

Overview

The App Intents framework describes actions and content to the system for integration with Siri, the Shortcuts app, Spotlight, and more. Since your app intent code doesn’t exist in isolation, the framework also includes API to write infrastructure code. If your app intent requires access to shared dependencies to perform its functionality, use AppDependencyManager and AppDependency to share dependencies across your intents, promote code reuse, and increase testability.

To take code reuse one step further and reuse intents across a suite of apps, consider creating a library of app intents with AppIntentsPackage. An advanced way to modularize code is creating an app intents extension with AppIntentsExtension. AppIntentsExtension serves as the registration mechanism for your app intents, and allows the system to discover and perform intents without launching your app.

In addition to providing API that helps you structure your app intent code base, the framework also provides you with information that allows you to adapt the behavior of your app intent for each invocation. For example, an intent might change its behavior depending on whether Siri, the Action button, widgets, or the Shortcuts app triggered the intent. To adapt your intent’s behavior, use IntentSystemContext to access information about the environment at runtime.

For gracefully retiring older intents, IntentDeprecation helps you phase out deprecated functionality while guiding people to your newer alternatives, ensuring a smooth transition for their workflows.

Topics

Code reuse

Supplementary content

See Also

Actions