Skip to main content
On Apple platforms that support App Intents, the Figranium Swift SDK exposes three system intents: running a task, stopping an execution, and checking execution status. You provide the client through a FigraniumIntentClientProvider so your app controls authentication and secrets. Intents never accept credentials as parameters.
App Intents support is compiled only when #if canImport(AppIntents) is true. Server-side Swift deployments without App Intents use the rest of the SDK unchanged.

Configure the client provider

Before the system can present any Figranium intent, call FigraniumIntentConfiguration.configure(_:) once at app launch with a provider that vends a configured Figranium client.
AppIntentProvider.swift
If you call an intent before configuring a provider, the SDK throws FigraniumError with code INTENT_NOT_CONFIGURED.

Available intents

RunFigraniumTaskIntent

Starts a task and returns a spoken dialog with the outcome. Signature:
  • Parameter: task (type FigraniumTask) — an AppEntity populated from FigraniumTaskQuery.suggestedEntities(), which lists task summaries from the server.
  • Result dialog: "<task.name> finished with <outcome>."
  • HTTP endpoint: POST /tasks/{id}/run (via client.runTask(_:))

StopFigraniumExecutionIntent

Stops a running execution by its run ID. Signature:
  • Parameter: runID — the execution identifier to stop.
  • Result dialog: "Stopped Figranium execution."
  • HTTP endpoint: POST /executions/{runID}/stop

GetFigraniumExecutionStatusIntent

Reads the current status of an execution and speaks it back. Signature:
  • Parameter: executionID — the execution identifier to query.
  • Result dialog: "Execution status: <status>." (falls back to outcome or unknown)
  • HTTP endpoint: GET /executions/{executionID}

Task entity and query

FigraniumTask is an AppEntity backed by FigraniumTaskQuery. The query fetches task summaries from the server and filters them by identifier.
  • suggestedEntities() calls client.tasks.listSummaries().
  • entities(for:) calls client.tasks.list() and filters by ID.

Register App Shortcuts

Expose intents to the Shortcuts app with an AppShortcutsProvider.
FigraniumAppShortcuts.swift

Security notes

  • Keep API keys in the Keychain or another secure app-owned store.
  • Intents never accept credentials as parameters. The provider is the only path the SDK uses to obtain a client.
  • If the provider throws, the intent surfaces the error through the App Intents system dialog.

Error reference