---
name: app-intents-widgets-controls-siri
description: "One App Intent across interactive widgets, Control Center, Live Activities, Shortcuts, Spotlight, and Apple Intelligence. Production App Intents for iOS 26: AppIntent with @Parameter, AppEntity/EntityQuery and AppEnum for typed inputs, perform() returning IntentResult with dialog/snippet, ProvidesDialog and ShowsSnippetView. Wires one intent into interactive WidgetKit views (Button/Toggle with intent), ControlWidget for Control Center, Live Activity push/dismiss, AppShortcutsProvider phrases for Siri and Spotlight, and AppIntentsPackage exposure to Apple Intelligence — plus background execution, openAppWhenRun, and ProgressReportingIntent."
license: MIT
---

# App Intents Multi-Surface

Build one `AppIntent` and surface it everywhere iOS 26 exposes intents: interactive widgets, Control Center, Live Activities, Shortcuts, Spotlight, and Apple Intelligence. This skill generates the Swift scaffolding and wiring so a single action — "Start Timer", "Log Water", "Toggle Focus" — works identically from a Home Screen widget button, a Control Center toggle, and a Siri phrase, without duplicating logic per surface. It's for iOS developers who already have an app target and want correct, idiomatic App Intents code instead of fighting compiler errors and surface-specific quirks.

## When to use it

- You have an action you want callable from more than one place (widget tap + Shortcuts + Spotlight).
- You're adding an interactive widget or Control Center control and need the intent behind a `Button`/`Toggle`.
- You want typed inputs (a picker of user data) backed by `AppEntity`/`EntityQuery` instead of free-text parameters.
- You want a Live Activity that updates from a button without launching the app.

## What it does

The skill writes an `AppIntent` conforming type with `@Parameter` properties, a `static var title`, and a `perform()` that returns an `IntentResult`. For data-backed inputs it generates an `AppEntity` plus an `EntityQuery` (so the parameter resolves to real records), and `AppEnum` for fixed choice sets. Dialog and inline UI come from conforming `perform()`'s return to `ProvidesDialog` and `ShowsSnippetView` via `.result(dialog:view:)`.

Surface wiring it produces:

- **Interactive widgets** — `Button(intent:)` / `Toggle(isOn:intent:)` inside your WidgetKit view, with the intent marked so it runs in-process.
- **Control Center** — a `ControlWidget` with `ControlWidgetButton`/`ControlWidgetToggle` bound to the same intent.
- **Shortcuts & Spotlight** — `AppShortcutsProvider` with `AppShortcut` entries and natural-language phrases.
- **Apple Intelligence / Siri** — assigns an `AppIntent` schema where applicable so the system can invoke it.

## Usage example

```swift
struct LogWaterIntent: AppIntent {
    static var title: LocalizedStringResource = "Log Water"
    @Parameter(title: "Amount") var amount: WaterAmount   // AppEnum

    func perform() async throws -> some IntentResult & ProvidesDialog {
        try await Store.shared.log(amount)
        return .result(dialog: "Logged \(amount.rawValue) ml")
    }
}
```

The skill then drops a matching `Button(intent: LogWaterIntent(amount: .glass))` into your widget and a `ControlWidgetButton` for Control Center.

## Tips & gotchas

- `perform()` runs in a short-lived extension process; do persistence through an App Group container, not in-memory singletons, or the app won't see the change.
- Add `openAppWhenRun = true` only when you genuinely need foreground — interactive widgets are meant to stay in-process.
- `EntityQuery.suggestedEntities()` is what powers Shortcuts pickers; if it's empty your parameter looks broken in the Shortcuts editor.
- After editing `AppShortcutsProvider` phrases, rebuild and relaunch — Spotlight/Siri indexing is cached and won't reflect changes immediately.

## FAQ

**Can the same intent power both a widget button and a Siri phrase?** Yes — that's the point. One `AppIntent` type, referenced from `Button(intent:)`, a `ControlWidget`, and an `AppShortcut`.

**Do I need iOS 26?** Control Center controls require iOS 18+, and the Apple Intelligence schema wiring targets iOS 26. Interactive widgets and Shortcuts work on iOS 17/16 respectively.

**Where does the inline snippet UI come from?** Conform `perform()`'s result to `ShowsSnippetView` and return `.result(view:)`; the skill scaffolds a SwiftUI snippet view for you.
