iOS 18: Siri not passing string parameters to AppIntents if the string is a question

Xcode Version 16.0 (16A242d)

iOS18 - Swift

There seems to be a behavior change on iOS18 when using AppShortcuts and AppIntents to pass string parameters. After Siri prompts for a string property requestValueDialog, if the user makes a statement the string is passed. If the user's statement is a question, however, the string is not sent to the AppIntent and instead Siri attempts to answer that question.

Example Code:

struct MyAppNameShortcuts: AppShortcutsProvider {
  @AppShortcutsBuilder
  static var appShortcuts: [AppShortcut] {
    AppShortcut(
      intent: AskQuestionIntent(),
      phrases: [
        "Ask \(.applicationName) a question",
      ]
    )
  }
}
struct AskQuestionIntent: AppIntent {
  static var title: LocalizedStringResource = .init(stringLiteral: "Ask a question")
  static var openAppWhenRun: Bool = false
  static var parameterSummary: some ParameterSummary {
    Summary("Search for \(\.$query)")
  }

  @Dependency
  private var apiClient: MockApiClient

  @Parameter(title: "Query", requestValueDialog: .init(stringLiteral: "What would you like to ask?"))
  var query: String

  // perform is not called if user asks a question such as "What color is the moon?" in response to requestValueDialog
  // iOS 17, the same string is passed though
  @MainActor
  func perform() async throws -> some IntentResult & ProvidesDialog & ShowsSnippetView {
    print("Query is: \(query)")
    let queryResult = try await apiClient.askQuery(queryString: query)
    let dialog = IntentDialog(
      full: .init(stringLiteral: queryResult.answer),
      supporting: .init(stringLiteral: "The answer to \(queryResult.question) is...")
    )
    let view = SiriAnswerView(queryResult: queryResult)
    return .result(dialog: dialog, view: view)
  }
}

Given the above mock code:

iOS17:

  • Hey Siri
  • Ask (AppName) a question
  • Siri responds "What would you like to ask?"
  • Say "What color is the moon?"
  • String of "What color is the moon?" is passed to the AppIntent

iOS18:

  • Hey Siri

  • Ask (AppName) a question

  • Siri responds "What would you like to ask?"

  • Say "What color is the moon?"

  • Siri answers the question "What color is the moon?"

  • Follow above steps again and instead reply "Moon"

  • "Moon" is passed to AppIntent

Basically any interrogative string parameters seem to be intercepted and sent to Siri proper rather than the provided AppIntent in iOS 18

Since you're seeing a change in behavior from iOS 17, the best course of action here is to file a bug report. Don't forget to include a small test project that can run on iOS 17 and iOS 18 with your steps to reproduce, as well as including a sysdiagnose that has the App Intents logging enabled.

Once you open the bug report, please post the FB number here for our reference.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

— Ed Ford,  DTS Engineer

iOS 18: Siri not passing string parameters to AppIntents if the string is a question
 
 
Q