Siri Intent: মূল ধারণা, SiriKit এবং Siri একীকরণ

লেখক: IT Sectr প্রকাশিত: 2026-02-15 পড়ার সময়: 9 মিনিট

Siri Intent is a mechanism for integrating an iOS app with the Siri voice assistant, allowing users to perform actions by voice without opening the app. Development is done in Swift using the Intents (Intents.framework) and SiriKit frameworks. Starting with iOS 16, App Intents appeared — a new, more flexible framework for creating custom voice commands. Siri Intent supports 10 domains (messages, calls, payments, notes, workouts, and others) and allows the app to process voice requests through IntentHandler. Let’s explore key concepts, architecture, and code examples.

মূল পদার্থ

  • Siri Intent — a voice command that performs an action in an app through Siri without opening it
  • SiriKit (iOS 10+) — a framework with predefined domains (messages, calls, payments)
  • App Intents (iOS 16+) — a new framework for creating arbitrary custom voice commands
  • IntentHandler — a handler that performs an app action in response to a Siri voice command
  • INInteraction — an object representing the result of executing an intent, saved in Siri for learning

Siri Intent কী

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 (INঅনুসন্ধানForছবিIntent), booking trips (INBookRestaurantReservationIntent), car functions (INSetCarLockStatusIntent). Each domain has a strict parameter schema and limitations defined by Apple for security.

SiriKit: আর্কিটেকচার এবং ডোমেন

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:

  • বার্তা — INSendMessageIntent, INঅনুসন্ধানForবার্তাIntent, INSetMessageAttributeIntent
  • কল — INStartCallIntent, INঅনুসন্ধানForCallHistoryIntent
  • পেমেন্ট — INSendPaymentIntent, INRequestPaymentIntent
  • নোট — INCreateNoteIntent, INঅনুসন্ধানForনোটIntent, INAddTasksIntent
  • রিমাইন্ডার — INCreateTaskListIntent, INAddTasksIntent, INSetTaskAttributeIntent
  • ব্যায়াম — INStartWorkoutIntent, INPauseWorkoutIntent, INEndWorkoutIntent
  • ছবি — INঅনুসন্ধানForছবিIntent, INStartPhotoPlaybackIntent
  • CarPlay — INSetCarLockStatusIntent, INGetCarLockStatusIntent
  • অনুসন্ধান — INঅনুসন্ধানForবার্তাIntent, INঅনুসন্ধানForNotebookItemsIntent

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: নতুন ফ্রেমওয়ার্ক

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:

  • AppIntent — a protocol for describing an action: title, description, parameters, perform()
  • IntentParameter — command parameters with types (String, Int, URL, Entity, Measurement)
  • IntentDialog — dialogs for Siri: confirmation request, success or error response
  • WidgetIntent — a subset of App Intents for handling widget taps (iOS 17+)
  • Shortcuts — App Intents automatically integrate with the Shortcuts app

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.

কোড উদাহরণ: Swift Intents

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+.

swift
import AppIntents

// 1. নোট যোগ করার জন্য কাস্টম Intent
struct AddNoteIntent: AppIntent {
    // কমান্ডের নাম (Shortcuts এ দৃশ্যমান)
    static var title: LocalizedStringResource = "নোট যোগ করুন"

    // কমান্ডের বর্ণনা
    static var description: LocalizedStringResource = "অ্যাপে এ একটি নতুন নোট তৈরি করে"

    // কমান্ডের প্যারামিটার
    @Parameter(title: "নোটের পাঠ")
    var noteContent: String

    @Parameter(title: "বিবিধ", default: "সাধারণ")
    var category: String

    // কার্য সম্পাদন
    func perform() async throws -> some IntentResult {
        // স্থানীয় সংরক্ষণাগারের মাধ্যমে নোট তৈরি
        let note = Note(content: noteContent, category: category)
        try await NoteStore.shared.save(note)

        // Siri এর জন্য একটি ডায়ালগ সহ ফলাফল ফিরে দিন
        return .result(
            dialog: .response("নোট "(noteContent)" তৈরি")
        )
    }
}

// 2. App Shortcut Provider — কমান্ড রিজিস্ট্রেশন
struct NotesShortcuts: AppShortcutsProvider {
    @AppShortcutsBuilder
    static var appShortcuts: [AppShortcut] {
        AppShortcut(
            intent: AddNoteIntent(),
            phrases: [
                "(.applicationName) এ নোট যোগ করুন",
                "(.applicationName) এ (.$noteContent) দিয়ে একটি নোট তৈরি করুন",
                "(.applicationName) এ (.$noteContent) লিখুন",
            ]
        )
    }
}

// 3. বার্তার জন্য SiriKit Intent (ক্লাসিক পদ্ধতি)
class MessageIntentHandler: NSObject, INSendMessageIntentHandling {

    func resolveRecipients(
        for intent: INSendMessageIntent,
        completion: @escaping ([INPersonResolutionResult]) -> Void
    ) {
        guard let recipients = intent.recipients else {
            completion([.needsRequired()])
            return
        }
        // অ্যাপের এড্রেস বুকের মাধ্যমে কন্টাক্ট সমাধান করুন
        let results = recipients.map { INPersonResolutionResult.success(with: $0) }
        completion(results)
    }

    func handle(
        intent: INSendMessageIntent,
        completion: @escaping (INSendMessageIntentResponse) -> Void
    ) {
        // অ্যাপের API এর মাধ্যমে বার্তা প্রেরণ
        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 inAppঅনুসন্ধানKeywords 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.

ParameterSiriKitApp Intents
Minimum iOSiOS 10iOS 16
Domains10 predefinedArbitrary
LanguageObjective-C / SwiftSwift (macros)
TargetIntents ExtensionMain app
UISiri UI (generation)Siri UI (generation)
ConfirmationFor payments/messagesOptional
ShortcutsManualAutomatic
Widget integrationNoWidgetIntent (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.

প্রায়শই জিজ্মেস করা প্রশ্ন

Siri Intent কী in simple words?

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.

How is SiriKit different from App Intents?

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.

What domains does SiriKit support?

SiriKit supports 10 domains: messages (INSendMessageIntent), calls (INStartCallIntent), payments (INSendPaymentIntent), notes, reminders, photos, workouts, trip booking, car functions, and search.

How does Siri Intent process voice input?

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.

Can Siri Intent execution be canceled?

Yes, after recognizing the intent but before executing it, Siri shows the user a confirmation. The user can cancel execution by voice (“বাতিল”) or by touch. For payments and messages, confirmation is mandatory.

সারাংশ

  • Siri Intent — a mechanism for integrating an app with Siri through voice commands without opening the screen
  • SiriKit (iOS 10+) — a framework with 10 fixed domains (messages, calls, payments) via Intents Extension
  • App Intents (iOS 16+) — a new framework for arbitrary custom commands with @Intent and @Parameter macros
  • IntentHandler — performs the app action, receives parameters from Siri, and returns an INInteraction with the result
  • Trigger phrases are set via .intentdefinition (SiriKit) or @AppShortcutsBuilder (App Intents)
  • Limitations — execution limit of 5–10 seconds, memory 30–50 MB, confirmation for sensitive actions
  • App Intents — preferred approach for iOS 16+, SiriKit — for supporting iOS 13–15

আমরা একটি মোবাইল অ্যাপ্লিকেশন টার্নকি তৈরি করব

IT Sectr 2017 সাল থেকে স্টার্টআপ এবং ব্যবসার জন্য iOS এবং Android অ্যাপ্লিকেশন তৈরি করে। আমরা আপনাকে পরামর্শ দেব এবং সেরা সমাধান প্রস্তাব করব।

প্রকল্প নিয়ে আলোচনা করুন

আরও পড়ুন