Siri Intent est un mécanisme dintégration dune application iOS avec lassistant vocal Siri, permettant aux utilisateurs deffectuer des actions vocales sans ouvrir lapplication. Le développement se fait en Swift avec les frameworks Intents (Intents.framework) et SiriKit. À partir diOS 16, App Intents est apparu — un nouveau framework plus flexible pour créer des commandes vocales personnalisées. Siri Intent prend en charge 10 domaines (messages, appels, paiements, notes, entraînements et autres) et permet à lapplication de traiter les demandes vocales via IntentHandler. Explorons les concepts clés, larchitecture et des exemples de code.
Points clés
Siri Intent is a mechanism that allows an iOS app to process voice commands spoken by the user through Siri. When the user says “Siri, send a message to Ivan on Telegram,” Siri recognizes the intent (INSendMessageIntent), identifies the app that can handle it (Telegram), passes the parameters (contact “Ivan,” message text), and launches the app’s IntentHandler. The entire process takes 0.5–2 seconds and does not require opening the app.
The architecture of Siri Intent includes three components. The first is the .intentdefinition file, which describes the intent structure: parameters (String, Integer, INPerson), trigger phrases, and responses. The second is IntentHandler, which implements the handling protocol: receives parameters, performs the action (e.g., sends a message through the app API), and returns an INInteraction with a result code. The third is Intents Extension, a separate target in Xcode that runs in its own process. Siri launches the Intents Extension on a voice request, passes it data, and receives the result. The Extension has no UI — it runs in the background and must complete within 5–10 seconds.
Siri Intent use cases: sending messages (INSendMessageIntent), making calls (INStartCallIntent), sending payments (INSendPaymentIntent), creating notes (INCreateNoteIntent), workouts (INStartWorkoutIntent), photos (INSearchForPhotosIntent), booking trips (INBookRestaurantReservationIntent), car functions (INSetCarLockStatusIntent). Each domain has a strict parameter schema and limitations defined by Apple for security.
SiriKit is a framework introduced by Apple in iOS 10 (2016). It provides ready-made domains (Intents) for typical actions: messages, calls, payments, notes, reminders, photos, workouts, booking, car functions, search. For each domain, Apple defined a set of Intent classes (INSendMessageIntent, INStartCallIntent) that the app implements through IntentHandler. SiriKit automatically generates a UI confirmation before execution (for payments and messages, confirmation is mandatory).
SiriKit Domains:
SiriKit limitations: developers cannot create custom domains — they can only use predefined ones. This limitation was resolved in iOS 16 with the introduction of App Intents, which allows creating arbitrary voice commands for any app actions.
App Intents is an Apple framework introduced in iOS 16 (2022) and significantly expanded in iOS 17–18. Unlike SiriKit with its fixed domains, App Intents allows developers to define their own voice commands for any app actions: “Siri, add milk to the shopping list in AnyList,” “Siri, schedule a meeting in Fantastical,” “Siri, turn on the living room light in Home.” Custom intents are defined through the AppIntent protocol with parameters, phrases, and a confirmation scheme.
App Intents Components:
App Intents vs SiriKit: the main difference is flexibility. SiriKit is limited to 10 domains, App Intents allows creating any commands. SiriKit requires a separate Intents Extension target, App Intents works inside the main app. SiriKit uses Intents.framework (Objective-C/Swift), App Intents uses a new declarative Swift syntax with @Intent and @Parameter macros. According to Apple, App Intents is used in 70% of new projects with Siri support as of 2025.
An example of creating a custom App Intent for adding a note to the app. Demonstrates the modern approach using the App Intents framework in iOS 16+.
import AppIntents
// 1. Intent personnalisé pour ajouter une note
struct AddNoteIntent: AppIntent {
// Nom de la commande (visible dans Shortcuts)
static var title: LocalizedStringResource = "Ajouter une note"
// Description de la commande
static var description: LocalizedStringResource = "Crée une nouvelle note dans lapplication"
// Paramètres de la commande
@Parameter(title: "Texte de la note")
var noteContent: String
@Parameter(title: "Catégorie", default: "Général")
var category: String
// Exécution de laction
func perform() async throws -> some IntentResult {
// Créer une note via le stockage local
let note = Note(content: noteContent, category: category)
try await NoteStore.shared.save(note)
// Retourner le résultat avec un dialogue pour Siri
return .result(
dialog: .response("Note "(noteContent)" créée")
)
}
}
// 2. App Shortcut Provider — enregistrement des commandes
struct NotesShortcuts: AppShortcutsProvider {
@AppShortcutsBuilder
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: AddNoteIntent(),
phrases: [
"Ajouter une note à (.applicationName)",
"Créer une note avec (.$noteContent) dans (.applicationName)",
"Écrire (.$noteContent) dans (.applicationName)",
]
)
}
}
// 3. Intent SiriKit pour les messages (approche classique)
class MessageIntentHandler: NSObject, INSendMessageIntentHandling {
func resolveRecipients(
for intent: INSendMessageIntent,
completion: @escaping ([INPersonResolutionResult]) -> Void
) {
guard let recipients = intent.recipients else {
completion([.needsRequired()])
return
}
// Résoudre les contacts via le carnet dadresses de lapplication
let results = recipients.map { INPersonResolutionResult.success(with: $0) }
completion(results)
}
func handle(
intent: INSendMessageIntent,
completion: @escaping (INSendMessageIntentResponse) -> Void
) {
// Envoyer un message via lAPI de lapplication
let response = INSendMessageIntentResponse(
code: .success, userActivity: nil
)
completion(response)
}
}
Key points: AppIntent — protocol for custom voice commands; @Parameter — macro defining command parameters; perform() — method that executes the action and returns a result with a dialog for Siri; AppShortcutsProvider — registers the app’s commands in Siri and Shortcuts; INSendMessageIntentHandling — SiriKit protocol for handling the message domain. Trigger phrases are set via .applicationName and \.$parameter for variability.
Recommendations for creating Siri Intents: define clear trigger phrases with pronunciation variants; return informative dialog after execution (success/error); handle cases of incomplete parameters through resolve methods with clarification requests; save INInteraction after execution for Siri learning; test on a real device (the simulator does not support Siri). For App Intents, use @Intent with inAppSearchKeywords to improve recognition.
Limitations: SiriKit Intents are limited to 10 domains. Intents Extension runs with a 5–10 second limit — if exceeded, Siri reports an error. Siri Intent has no UI — all interface is generated by Siri. App Intents are only available on iOS 16+ (~85% device coverage as of 2026). For supporting iOS 13–15, SiriKit must be used. Privacy: Siri does not transmit audio recordings to the app — only the recognized parameter text. For sensitive actions (payments, messages), user confirmation is mandatory.
| Parameter | SiriKit | App Intents |
|---|---|---|
| Minimum iOS | iOS 10 | iOS 16 |
| Domains | 10 predefined | Arbitrary |
| Language | Objective-C / Swift | Swift (macros) |
| Target | Intents Extension | Main app |
| UI | Siri UI (generation) | Siri UI (generation) |
| Confirmation | For payments/messages | Optional |
| Shortcuts | Manual | Automatic |
| Widget integration | No | WidgetIntent (iOS 17+) |
Performance and debugging: Intents Extension runs in a separate process with a memory limit of 30–50 MB. For debugging, use the “Intents Extension” scheme in Xcode attached to the Siri process. Logs are output to the device console. App Intents are debugged through the Shortcuts app on the device. INInteraction is saved locally and used by Siri for suggestions — delete outdated interactions via INInteraction delete.
Frequently Asked Questions
Siri Intent is a voice command that triggers a specific action in an app without opening it. The user says “Siri, send a message on WhatsApp” and Siri performs the action through the IntentHandler of the WhatsApp app.
SiriKit (iOS 10+) is an older framework with predefined domains (messages, calls, payments). App Intents (iOS 16+) is a new framework that allows creating custom intents for any actions without domain limitations.
SiriKit supports 10 domains: messages (INSendMessageIntent), calls (INStartCallIntent), payments (INSendPaymentIntent), notes, reminders, photos, workouts, trip booking, car functions, and search.
Siri recognizes speech and matches it to a specific Intent based on phrases defined in .intentdefinition. IntentHandler performs the action and returns the result. The entire process takes 0.5–2 seconds.
Yes, after recognizing the intent but before executing it, Siri shows the user a confirmation. The user can cancel execution by voice (“Cancel”) or by touch. For payments and messages, confirmation is mandatory.
Summary
Nous développerons une application mobile clé en main
IT Sectr crée des applications iOS et Android pour les startups et les entreprises depuis 2017. Nous vous conseillerons et vous proposerons la meilleure solution.
Lisez aussi